teleren/devto huggingface dataset:
Recipe of healthy life for programmers
Tags: javascript, programming, productivity, webdev
Published: 2021-10-03 01:06:05

Being healthy should be the first and foremost goal of any human being. As a programmer, it is even more crucial. Keep aside all of those tasks like building a hobby app, learning new technology, and all. If you are not healthy at all, nothing is going to matter. If you don't have time to invest in your health now, be prepared to waste a huge amount of time and money in the hospital in near future.

I am also still developing this habit of following a healthy lifestyle. After eating frequently in restaurants and processed foods, I feel like lot of money is being invested in making myself unhealthy. It is quite hard to cut yourself away from the processed foods but you can still try to minimize as much you can. Sometimes during hangouts or parties we consume some food that are really unhealthy for our body and brain. There are few solutions I generally recommend programmers or any professional who work from home to follow. Here are some of the tips I find are useful for me and hope it will be useful for someone else:
1. (30mins-1hr) long workout,
2. Try something like yoga,
3. Practice gratitude (for mental health),
4. Cut off negative people,
5. Work in chunks - 60mins followed by 10-15min break (but don't use social media on those breaks),
6. 6 days healthy food,
7. Intermittent fasting,
8. Drink enough water,
9. Protective glasses for screen,
10. Some push ups after long time sitting in chair,
11. Some back exercises to prevent back pain,
12. To avoid burnout you can try something that is different from what you generally do for example learning music,
13. Try to cut off sugar if you can,
14. Avoid screen 1hr before going to bed,
15. No phone after waking up (you can use if after you are done working for sometime on the most important goal of your life)
16. Do something quick and easy in the morning to keep you motivated
17. Practice katas everyday. It can be programming kata, guitar kata or anything to be more dexterous. 

There must be more than these that I would love you hear from you guys. Let me know what you do to keep yourself healthy and motivated. Thanks for reading this post.
Lambda Result Package is Live!
Tags: lambda
Published: 2022-02-05 13:28:27

---
title: Lambda Result Package is Live!
published: true
date: 2021-10-03 00:14:37 UTC
tags: lambda
canonical_url: https://mahmutcanga.com/2021/10/03/lambda-result-package-is-live/
---

![](https://sufidev.files.wordpress.com/2021/10/creative-headline-f10nthkciw8-unsplash.jpg?w=1024)

I have been tinkering with this idea of releasing something open source for a while. Recently, I have started to use a pattern in my Lambda code that became so much handy and productive.

Today, I’m happy to release it and hopefully it will be useful for you too!

[https://github.com/macromania/lambda-result](https://github.com/macromania/lambda-result)
What's new in TailwindCSS v3
Tags: webdev, programming, javascript, tailwindcss
Published: 2021-10-03 09:34:54

---
title: What's new in TailwindCSS v3
published: true
date: 03/10/2021
tags: webdevelopment, programming, JavaScript, TailwindCSS
canonical_url: https://www.elian.codes/blog/10-03-21-what-is-new-in-tailwindv3/
---

[TailwindCSSv3.0.0-alpha-1](<https://github.com/tailwindlabs/tailwindcss/releases/tag/v3.0.0-alpha.1>) was released yesterday! It's not a full release of v3 yet, but might already give us an insight on what is to come with TailwindCSS v3.

I went through the release notes and summed up some things that I found importand below.

## New

In TailwindCSS v3, JIT will be the default compiler mode. If you want to learn more about the Just-In-Time compiler, [check this blogpost](<https://www.elian.codes/blog/what-is-tailwindcss-jit-and-how-to-use-it/>).

All colors are enabled by default. Before you had to import them via the `tailwind.config.js`.

new utilities:

- `aspect-ratio`
- `scroll-snap`
- `scroll-behavior`
- `text-indent`
- `column`
- `touch-action`
- `will-change`
- `border-x` & `border-y`

new variants:

- `file:` -> for the native file upload button styling
- `open:` -> for styling native `<details>` & `<dialog>` elements

### Using JIT in CDN mode

Before, when using the TailwindCSS CDN, you had to give up on a lot of configuration functionality. Well, that isn't the case anymore since TailwindCSS v3. But TailwindLabs noted: **TailwindCSS CDN JIT is intended for development only, do not use in production!**. So there is probably still something in the works there.

Using the TailwindCSS CDN JIT isn't that hard:

```html
  <!DOCTYPE html>
  <html lang="en">
    <head>
      <!-- add base TailwindCSS -->
      <script src="https://cdn-tailwindcss.vercel.app/"></script>

      <!-- add Plugins -->
      <script src="https://cdn-tailwindcss.vercel.app/?plugins=forms,typography,aspect-ratio,line-clamp"></script>

      <!-- customize config -->
      <script>
      tailwind.config = {
        theme: {
          extend: {
            colors: {
              tomato: 'tomato',
            },
          },
        },
      }
    </script>

    <!-- add custom styling -->
    <style type="text/tailwindcss">
      body {
        @apply bg-pink-500;
      }
    </style>
    </head>
    <body>
      <!-- -->
    </body>
  </html>
```

## Breaking

- PostCSS 7 won't be supported any longer
- `purge` option in `tailwind.config.js` has changed to `content`
- `overflow-clip` utility was changed to `text-clip`

## Notes

If you decide on trying TailwindCSS v3 early, be sure to update the @tailwindcss dependencies to like `@tailwindcss/typography` and `@tailwindcss/forms`

You can install or upgrade both `tailwindcss` and its dependencies by adding `@next` as a release:

```bash
npm i -D tailwindcss@next
npm i -D @tailwindcss/typography@next
```

All official releasenotes can be found [on the TailwindCSS GitHub repo](<https://github.com/tailwindlabs/tailwindcss/releases>).
Check out the official [TailwindCSS Documentation](<https://tailwindcss.com/docs>)
DHCP and static IPs ??
Tags: devops, beginners, dhcp, networking
Published: 2021-10-02 23:07:16

I'm not gonna talk about how does a DHCP server work exactly, 
this Post is destined for those who understands that already but still got some dark spots with their knowledge about the topic,
this is simply an explanation for the famous problem : 

> __If one of the devices in the network is configured with a static IP address, when the DHCP server starts distributing the IP addresses to other machines, what happens exactly ? does it skip it ? or does it duplicate it and therefore there would be a conflict ?__ 


So the answer is, __NOPE__ the DHCP server will not distribute that IP address, you may be wondering, but how ?

Remember that the DHCP server sends an ARP Broadcast asking about the IP address about to be distributed 
>__"Who has x.x.x.x"__


At that moment the machine with that static IP address will respond with an ARP saying that it got that IP and that its MAC address is X:X:X:X:X:X so the DHCP server will continue to the next IP address asking "Who has y.y.y.y"
and therefore there will be no duplication.

But here comes another problem, 
>__what if the local network is placed behind a router, and we all know that the routers doesn't allow broadcasting, then what happens ?__

well simply instead of ARP Broadcasting, it uses ICMP Packet type 8 code 0 which is the ECHO request ( ping ) and if it gets no answer than it distributes it, else it simply continues to the next IP address.

And here comes the last question, 
>__And what if a device that is configured with a static IP address was shutdown, and the DHCP distributed its IP address, what happens if the machine is up again?__


well there are two solutions for this, some DHCP servers are advanced enough and caches the static IP address and therefore this conflict will never occurs, but if the DHCP server doesn't provide this feature, than it should be configured to exclude these IP addresses or else there will be an IP Duplication.

And this pretty much sums up the main problems of dealing with a DHCP server.
How I Build a System? #1
Tags: devjournal, career, programming, motivation
Published: 2021-10-02 22:14:56

The system is word can have many of perspective, system can't be pure said with nude word a _"SYSTEM"_. Maybe word of system is an acronym; _"Sing Your Song To Encourage Money"_, you know what I am saying. So let me write a poem to describe how I build a system (actually a song) with lyrics, diction, feeling, and many more.

I was telling this in many of article on internet and statement in real life. How language it's so powerful to interpreting some kinds of life and experience, that's how Machine Learning work and AI in this moments.

I am just a stupid man with low education (formally) and experience in this field (tech). But, I found how language it's so naturally beautiful.

First of all, song can't be write of create without past experience. How experience work in usually? Yes, experience is a best teachers in life. So for now we have a diction.

Then with diction we can figured it what that's matters in life, Right?

Then we have a future / goal to write what kind of vision we can reach. From now we have to start write poem.

![ETANIMULLI #1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bgqpwgyxera6s3rsj0wp.png)

> Today is an enemy
> but tomorrow maybe is a recovery
> with no medicine, just imagine
> I will free for while in a mile

> Free from anyone
> Free from enemy

> So listen, I am sing with this song
> I know what it's.. (Yes, you know) so long
> I think it is wrong
> the truth is strong

To be continued...
How to contribute to Chatwoot on Github?
Tags: github, opensource, beginners, chatwoot
Published: 2021-10-02 21:01:26

Customer management software can be very useful in managing customer’s needs and having meaningful conversations. Fortunately, there are existing tools to help you out. We have  [Intercom](https://www.intercom.com/fr),  [Zendesk](https://www.zendesk.com/), or  [Drift ](https://www.drift.com/) with features like social media integration, chatbots, and shared team inboxes. But there is one particular tool;  [Chatwoot ](https://www.chatwoot.com/) that stands out with intuitive design and its most valuable characteristic; it’s completely open-source.

The post sheds light on how users can make contributions to a Chatwoot project on  [Github](https://github.com/chatwoot/chatwoot). But first of all, let’s talk about some solid reasons to contribute to Chatwoot.

‌Read  [more](https://aviyel.com/post/801/how-to-contribute-to-chatwoot-on-github) .
Git hooks and Docker for Continuous integration - part 1
Tags: docker, devops, cloud, codequality
Published: 2021-10-02 19:59:48

![Alt continuous integration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6vihzk09exdwfgu710kk.png)

---

Continuous Integration is a great software development practice, we can reduce integration problems and we can allow teams to develop cohesive software more rapidly.

There are many interesting CI tools in the market but I think the dev CI experience can still be improved. I see companies and dev teams struggling and disappointed when they have to run and setup CI pipelines.

---

### Security:
* Most of the IT companies care about code privacy and they don’t like the idea to run their code on external public CI platforms. It's possible to have CI solutions on-premise but most of the time this kind of solutions are expensive for the company. For example, Atlassian has stopped selling new on-prem server licenses. [ref.](https://www.atlassian.com/migration/assess/journey-to-cloud)

---

### Build queue and CI debug:
* As a developer and member of a tech team I’d like to see our CI builds running immediately after a code change and I’d like to see an easy way for debugging the code when it’s running on CI. Most of the time I see teams and developers complaining about long builds queues and usually it’s even quite difficult debugging the code if an error happens during the CI process.

---

### Cloud costs:
* How many times we see commits failing on CI because the code has not been tested enough locally or the code has not been rebased with the main branch yet. Every time we run a build on Cloud it’s a cost for the team and the company. The good news is we can now easily avoid this scenario. Few years ago, Git has introduced "Git hooks", this new technology allows developers to execute pre-tests before a commit will trigger a new CI process in Cloud.

---

After a long brainstorming with some friends, we created a small CI tool [localci.io](localci.io) to address all these issues. This tool doesn’t fit with any IT infrastructure, but this could be useful at least for some team. Probably, in the future it will be completely free but currently we still need to cover some cloud costs.

Article part 2: [Git hooks and Docker for Continuous integration - part 1](https://dev.to/simone_a/git-hooks-and-docker-for-continuous-integration-part-2-54jb)
Laravel scaffold command
Tags: php, laravel, webdev
Published: 2021-10-02 20:30:38

Hi artisans, i created a package called [Laravel scaffold command](https://github.com/Tefoh/laravel-scaffold-command), adds an artisan command that you can generate necessary files for crud applications, either you use laravel as fullstack or a rest-api this can help you.

## installation
```shell
composer require tefoh/laravel-scaffold-command
// then
php artisan vendor:publish --tag=scaffold-stubs
```
Thats it and just enter the model or entity you want crud operation with the fields needed. The fields is two parts, first is field name and second is field type this two separated with a colon. The field type must be from laravel migrations available column types, heres the link https://laravel.com/docs/8.x/migrations#available-column-types. For example to create a crud operation for Category enter this:
```shell
php artisan scaffold Category --fields=name:string,slug:string,parent_id:foreignId
```
And for rest-api just add api parameter to create necessary resources instead of views. And controller will be a bit different:
```shell
php artisan scaffold Tag --api --fields=name:string,slug:string,parent_id:foreignId
```
The original idea comes from ruby on rails, they have a similar command. The beauty of this package is you can use laravel stubs and fully customize how controllers and views created when you enter this command. I hope this will be helpful for you :)
Starting a Rails API...
Published: 2021-10-02 20:01:38

Rails is the only backend framework that I've used so far to create APIs for my apps. So, I decided to write a post about how to start a project with a Rails API. 


**Step 1. Create the directory**

mkdir my_api 

**Step 2. Navigate into the directory**

cd my_api

**Step 3. Create the Rails API**

In the same directory, run: 

$ rails new my_api --api 

The --api flag will create the app without additional features such as views that Rails would create if you ran just rails new. 

*optional: you can specify which database you want to use with the database flag, like this: 

--database=postgresql

**Step 4. Create Directories for Version Control**
Inside the controllers directory, create an api directory. 

mkdir my_api/app/controllers/api 

Inside api, create a v1 directory (for version 1).

mkdir my_api/app/controllers/api/v1
 
If at some point you decide to change the way your API serves data, you can create a v2 folder, and change the way the API works without starting all over. 

**Step 5. Generate your Models and Controllers!**

There are several ways to approach this with rails generators. You can choose to create models and controllers individually, by running rails g model Thing and rails g controller Thing, you can also use rails g resource Thing which will create both...or to really see the power of Rails, you can use rails g scaffold Thing (I usually avoid this because it usually generates too much for what I need). 

**6. Run your migrations!**

In terminal: 
rails db:migrate 

**7. Start Server!**
Again in terminal, run: 
rails s 

and then navigate to localhost:3000 


voila!
How to Stake Funds on SushiSwap using Arbitrum
Tags: defi, ethereum, sushiswap, arbitrum
Published: 2021-10-02 19:29:03

#Intro

Sushiswap is a DeFi platform where you can provide liquidity to pools and earn interest, as well as borrow collateral and swap various tokens.

Arbitrum is a layer-two Ethereum Network. That means it does not operate directly on Ethereum, but instead only "settles" on the layer one. All of the computing is done off-chain, which results in lower gas fees for the users, while still retaining the decentralized, secure, consensus mechanisms that run Ethereum.


# Getting funds to arbitrum

You will need to use the [Arbitrum bridge](https://bridge.arbitrum.io/) to get all of your current Ethereum from the mainnet to Arbitrum.

It can take up to 10 minutes for your funds to show up on the network, so do not freak out if you are unable to see your funds immediately.

After that you can then begin operating on SushiSwap through the Arbitrum Network.

# Staking on Sushi
Go to [SushiSwap](https://app.sushi.com/swap) and make sure your wallet is connected, and then change the network to Arbitrum. 

It should look like this when you're done:
![Shows SushiSwap UI focused on the network and wallet connection](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/14ookk19s7c3vqmklavx.png)

After that you will need to [find a pool](https://app.sushi.com/farm) you want to provide liquidity in.

It is sorted currently top to bottom by %APR. The more liquidity is needed, the better the returns. After you find a pool you want to stake in, you will need to go to the swap tab to swap for the relevant tokens.

For example, if you wanted to farm the "WETH/LINK" pool, you will need an equal value amount of each token. You can use the swap feature on Sushi to obtain the correct amount of each token.

After you have the tokens, you will be able to provide liquidity to the pool by depositing it like so:

![SushiSwap UI showing the deposit pool](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4colvdhqlhb3gb6pzs5i.png)

After depositing the two tokens to the pool, you will receive some SLP/KLP, which you can then move over to the "staking" tab. You will then begin farming rewards from the pool, in the relevant token. Each pool will show you what the rewards you will be getting are.

Having done those steps, you can then pull out your rewards, stake, and tokens at a later date of your choosing!

![SushiSwap UI displaying the rewards system](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nlunfcrny3a47k817mk3.png)

**Disclaimer that none of this is financial advice!!**
100 Days of Code: Día 1
Tags: 100daysofcode, spanish, ios, beginners
Published: 2021-10-02 19:25:31

Qué bueno que ya se me está haciendo costumbre esto de escribir unas cuantas líneas en mi perfil y pues el día de hoy, como les mencioné en mi Twitter, voy a estar en el reto #100DaysOfCode para poder fortalecer mis skills y estar aún más al tiro en lo último de código. 

![Smith-Oracle](https://media.giphy.com/media/MQ5TBGnQOFeMg/giphy-downsized-large.gif)

## ¿En qué consiste?

El reto consiste en programar al menos durante 1 hora diaria durante 100 días, con el fin de poder crear o reforzar conocimientos adquiridos previamente y publicando dichos avances durante la misma cantidad de días. Muchos solo lo hacen por Twitter, sin embargo otros más lo hacen en sus respectivos canales de YouTube, Twitch, DEV.to, etc.

Las reglas del reto son las siguientes:

* Programa 1 hora durante 100 días
* Publica tus avances
* Motiva a 2 personas al día a que comiencen el reto.

Si quieres saber más sobre esta iniciativa, visita https://www.100daysofcode.com/, la página oficial de la iniciativa.

## ¿Cuál es tu objetivo para esta iniciativa?

![I'm going on an adventure !!!](https://media.giphy.com/media/oj2GhTqAIoNIk/giphy.gif)

Pues bien, ha habido varios rubros que necesito reforzar como desarrollador, entre los cuales veo los siguientes:

* iOS con Swift
* React (JS, Native y Gatsby)
* Angular (actualizarme)
* GraphQL
* Microservicios
* Uso de Cloud Development (Lambdas)

Igualmente, les dejo el enlace al repositorio de la bitácora para que puedan checar más a detalle los avances en https://github.com/RZEROSTERN/100-days-of-code

Por lo tanto, para este día 1 ¿qué les parece si nos ensuciamos un poquito las manos con **iOS**? Para esta ocasión, armaremos un proyecto *Hello World!* con Swift :3. A más tardar, el día de mañana les comentaré las actualizaciones del día.

## Update: CocoaPods

El proyecto en cuestión he podido prepararlo e implementar CocoaPods. Para los que no van empezando, CocoaPods es el repositorio de librerías para iOS, con él puedes tener las capacidades que tiene Android con Maven. Está hecho con Ruby y da mayor flexibilidad a tu desarrollo iOS.

Para instalar CocoaPods tienes que hacer lo siguiente:

0. Instala CocoaPods en tu Mac con el siguiente comando:

```shell
sudo gem install cocoapods
```

1. Crea un proyecto de app en XCode.
2. Cierra XCode y abre una terminal.
3. Ejecuta los siguientes comandos a nivel de la **carpeta raíz de tu proyecto**:

```shell
pod init
pod install
```
Finalmente abre el archivo **.xcworkspace** que se ha creado. Al haber instalado CocoaPods correctamente, observarás que ha cambiado el layout del proyecto al siguiente:

![Screen Shot 2021-10-04 at 10.36.47](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v5dtuf92hmh3khths2no.png)

Ahora sí podemos comenzar con el desarrollo de nuestra app en iOS y concluir con el día 1 de #100DaysOfCode. Lo que prosigue es hacer la pantalla de splash y comenzar con el diseño de una interfaz dentro del Storyboard de iOS.

Happy coding !!!
Add Version Control and Remote Access to a Plain Repo
Tags: github, git, repo, beginners
Published: 2021-10-02 19:13:39

Here's a super simple tutorial for beginners. So simple that it's essentially exactly what GitHub posts on its site to help people out with this exact situation. I merely added three lines of commands to fill in some unfortunate gaps.

# Scenario

You have a repo on your computer with all the code you need for your project. It works great. The only downside? It doesn't have any version control. As in, it ain't a Git repo. As a result, it also isn't shared anywhere (e.g., GitHub). You want to fix this, but how?

If you log in to your GitHub account and create a new repo, it gives you three different options for building out your shiny new remote repo. The second option makes the most sense for this scenario: "…or push an existing repository from the command line." You do have an existing repo, and you do love the command line. However, if you merely `cd` into your existing repo and run the three commands that GitHub provides, you'll quickly see that you actually need do a few more steps to accomplish your goal.

# Solution

Here's my full guide to Git-ifying an existing repo and migrating it to GitHub.

After logging in to your GitHub account and creating a new repo, go back to your Terminal app and `cd` into your local repo. Then:

1. `git init`
2. `git remote add origin https://github.com/<YOURUSERNAME>/<YOURREPONAME>.git`
3. `git branch -M main`
4. `git add .`
5. `git commit -m "Add initial files from local"`
6. `git push -u origin main`

Note that steps 2, 3, and 5 are verbatim from GitHub's recommendations. While my three "missing steps" may seem painfully obvious to any experienced developer, I wanted to highlight them for the more junior members among us.