teleren/devto huggingface dataset:
50 Essential Tips for Every Developer.
Tags: productivity, beginners, career
Published: 2020-10-18 21:23:28

Whether you are starting to program or you are twenty years into your career, there is something here for you. Enjoy!

### 1. You are never ready. That's the fun part.
### 2. Focus on one thing at a time.
### 3. Just start! You'll figure everything out automatically.
### 4. Build. Build. Build again. 
### 5. Sleep is important.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/k95jvgeyq2zcqt8l0pi2.png)
### 6. Asking for help is not a sign of weakness.
### 7. Watching every tutorial won't make you a developer.
### 8. Writing your own code will make you a developer.
### 9. You only need the fundamentals. 
### 10. Always plan your work.  
### 11. Have other hobbies. If programming is your hobby, explore new fields.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/g7vf48t35u0t7rjce492.png)
### 12. Expect more from yourself than others will.
### 13. Take your time and write tests.
### 14. Read blog posts. Listen to podcasts. Subscribe to newsletters.
### 15. Learn to read the documentation.
### 16. Make a lot of mistakes.
### 17. Quit looking for perfection. If it works, it works.
### 18. If it works, touch it.
### 19. Take a break.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/05uvav8hyfu1urrxpnc8.png)
### 20. Connect with more people.
### 21. Pair program if you can.
### 23. Teach others what you know.
### 24. Look for mentorship. If you can mentor someone, do it.
### 25. Read more books. Fiction and Non-fiction.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/bviuqsitx44cfnt5tw0c.png)
### 26. If you honestly think you are bad, pretend you are a good programmer and never stop pretending.
### 27. Do not quit.
### 28. If the tools you use feel like magic, start digging in and see under the hood.
### 29. If you don't understand, copying is not the best idea.
### 30. Watch conference talks on YouTube.
### 31. Attend meetups and conferences too if you can.
### 32. Always be a team player unless you work as an independent person.
### 33. Readability is way more important than shortness.
### 34. Learn more what you like than what you think you should.
### 35. Find a balance between theory and practice.
### 36. Invest in your development setup.
### 37. Learn. Keyboard. Shortcuts.
### 38. Be consistent.
### 39. Try a new language.
### 40. Define your payment terms explicitly.
### 41. Enjoy your little winnings.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/l4dkc20yhx83vkphp0h9.png)
### 42. Don't be scared to show off your work.
### 43. Learn to comment your code.
### 44. Listen to advice but make your own decisions.
### 45. Support other developers. Sponsorships and the likes.
### 46. Learn from everything and everyone and never miss the opportunity to learn.
### 47. You should not be afraid to have simple solutions to simple problems.
### 48. Take care of your mental and physical health.
### 49. Try explaining concepts in writing and publishing.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/c685hi8tmjfwmgagahny.png)
### 50. At the end of it all, there is family.
Last month I learnt - ruby can be weird
Tags: tech, ruby, rails, csv
Published: 2020-10-18 20:29:37

---
title: Last month I learnt - ruby can be weird
published: true
date: 2020-10-18 20:06:00 UTC
tags: Tech, ruby, rails, csv
canonical_url: https://ngarindungu.github.io/tech/2020/10/18/last-month-i-learnt-ruby-is-weird.html
---

I was working on a task that involved parsing data from CSV files and saving it into rails models when I noticed something that didn’t look right. On calling `to_json` on one of the parsed csv rows, I got;

```
{
  "": null,
  "name": "John"
}

```

For context, I was parsing the CSV using the `headers: true` option, and for some reason, I had an empty header. Since we all know that developers don’t make mistakes, it had to be an issue with the data. So, I went hunting.

Another lesson, if you’re looking for an issue with data, open it in it’s raw form. Opening the csv with LibreOffice Calc and choosing the helpful defaults, opened a perfectly good sheet, and surprise, no missing header! Just as I was about to concede that it might be me, I opened the file in my editor(vim) and despite the ugliness, the trailing comma on each line was hard to miss.

With a possible culprit found, it was back to the code to try and get rid of that entry. Q; which ruby type would result in an empty string in json? Now, if you use ruby I’d assume there’s literally no time you’ve wanted to use an empty string as a key in your hash, right? But still it get’s weirder, on calling `to_h` on the row;

```
{
  nil => nil,
  "name" => "John"
}

```

What?! Yes, `nil` is a valid key in a ruby hash. I had to fire up plain irb to make sure it wasn’t rails messsing with me. And just to be sure, I confirmed that it’s also possible to retrieve the value normally with `hsh[nil]`

> P.S If you ever find yourself needing to read json exported from mongo, `BSON::ExtJSON.parse` is your friend.
My dilemma as a beginner web dev
Tags: beginners, webdev, discuss
Published: 2020-10-18 21:12:11

As a web developer who has just began creating public projects, I find it hard to come up with ideas that are suitable for mass interest. Basically, I am unsure of what I should create that would show good skill but show a bit of personality as well.

With that being said, I also would like to know of any libraries or languages besides just basic static site skills as many MANY developers have these skills. My questions is how can I stand out as a self-learning frontend web developer?
Constantes O(1)
Tags: bigonotation, computerscience
Published: 2020-10-15 20:34:35


Fazemos isso contando as operações, exemplo:

```go
package main

func main() {

}

func constante(n int) int {
    return n * (n + 1) / 2
}
```

Aqui temos, uma multiplicação, uma adição e uma divisão. três operações.

E ai não importa se **N** é 2 ou 1 bilhão, o numero de operações é o mesmo, três! Essa é uma complexidade de _O(3)_ é um tipo de complexidade constante pois o numero de operações não muda mesmo que o input seja diferente.  
Só que, em Big O a notação tem regras onde você não precisa ficar somando cada operação, _O(3)_ ou _O(200)_ no final tempo constante é sempre _O(1)_.  
Geralmente se ignora as constantes em um algoritmo, por que a notação big O se importa com o comportamento do algoritmo à medida que a entrada cresce muito, e não com os detalhes exatos pra todos os tamanhos. Quanto maior a entrada fica, menos importante as constantes vão se tornando. Por isso todo algoritmo com número de operações constante tem tempo de execução em _O(1)_ .

![](https://cdn-images-1.medium.com/max/800/1*TVLSKfjYYMpMLCdps-z2GA.png)

Nesse gráfico fica bem explicito o como uma complexidade constante se comporta, no eixo **vertical** temos a relação de tempo e **horizontal** a de **N** (input) temos um ultimo input de **10tb** sobre esse algoritmo do exemplo e nessa simulação ele não leva nem um milésimo de execução. Mais a frente olharemos o mesmo gráfico em perspectiva a diferentes complexidades.
React.js: How To Get Data From An API With Hooks and Axios
Tags: react, showdev, javascript, beginners
Published: 2020-10-18 21:09:32

---
title: React.js: How To Get Data From An API With Hooks and Axios
published: true
description: Quick beginner tutorial on understanding how to make API or HTTP requests in a React.js application using hooks and axios! I'll be covering some basic concepts like making HTTP requests with axios and the useEffect hook, manage that data with the useState hook, and finally showing you some libraries that will make all of it so much simpler!
tags: react, showdev, javascript, beginners
---

In this video I talk about the basics of making an API or HTTP request in a React.js application. I show examples of utilizing state and effect hooks, and how to manage loading and error states while making API requests with axios.

If you have any feedback, good/bad would love to hear it! 

{% youtube _5Ro8MVMGuQ %}
Publicar en dev.to 🤪
Published: 2020-10-18 20:49:16

Hace mucho tiempo que no escribo nada para dev.to. Es por el simple hecho de que no sé  utilizar las herramientas de esta comunidad 
para explicar con código en la interfaz del blog.

Por tanto agradecería la ayuda de alguien con unos tips de como publicar en dev.to y como mostrar código vivo y no, como en mis primeras publicaciones. 

De ante mano, gracias por tomarte el tiempo de leer.
Hello Universe
Tags: hello, intro
Published: 2020-10-18 20:26:05

# Introduction

Hi, I’m Regis. I'm a seasoned full stack engineer with a focus on building immersive, best-in-class experiences for the web.

My work experience over the last couple decades has been expansive. I've freelanced as a multi-media designer and engineer to make ends meet; I've worked for myself creating award-winning software used by millions of people each day; and I've worked at both a tiny tech startup with as little as six people all the way to one of the largest tech companies in the world. I'm currently at Google building, leading, and managing engineering teams for [Google News](https://news.google.com).

# Why am I on DEV?

My journey is somewhat unique, and I’ve been a technical and professional mentor to team members and colleagues for decades. I've applied my own experiences to help all sorts of people; whether new hires understand the complexities of writing software, or seasoned engineers achieve high-level career positions. I’m here to help.

But mostly, I just like sharing things I’ve learned, whether from yesterday or 15 years ago.
How to purge Bootstrap
Tags: css
Published: 2020-10-18 20:23:05

First of all I use Visual Studio Code as my editor, so I don't know how to do it in your prefered editor.

To get started, make a new project or use one of your existing ones with bootstrap already installed. Then open the project and click "F12" and look for the three dots -> More Tools -> Coverage.
That's where you will see if how much of Bootstrap CSS is actually being used.

Now, go to your VSCode and open your project and open your terminal by pressing CTRL + "~". Once you do that you'll need to install Node and NPM by simply typing "npm install"
Then you need to install Purgecss, which is done by simply adding "npm i -g purgecss" in your terminal again.
Some loading will occur and once they are done we are ready to make the magic happen.

To see the available options for the CLI: purgecss --help

Usage: purgecss --css <css> --content <content> [options]

Options:
  -con, --content <files>  glob of content files
  -css, --css <files>      glob of css files
  -c, --config <path>      path to the configuration file
  -o, --output <path>      file path directory to write purged css files to
  -font, --font-face       option to remove unused font-faces
  -keyframes, --keyframes  option to remove unused keyframes
  -rejected, --rejected    option to output rejected selectors
  -s, --safelist <list>   list of classes that should not be removed
  -h, --help               display help for command
The options available through the CLI are similar to the ones available with a configuration file. You can also use the CLI with a configuration file.

#--css
purgecss --css css/app.css css/palette.css --content src/index.html
#--content
You can specify content that should be analyzed by PurgeCSS with an array of filenames or globs. These files can be HTML, Pug, Blade, etc.

purgecss --css css/app.css --content src/index.html src/**/*.js
#--config
You can use the CLI with a configuration file. Use --config or -c with the path to the config file.

purgecss --config ./purgecss.config.js
#--output
By default, the CLI outputs the result in the console. If you wish to return the CSS as files, specify the directory to write the purified CSS files to.

purgecss --css css/app.css --content src/index.html "src/**/*.js" --output build/css/
#--safelist
If you wish to prevent PurgeCSS from removing a specific CSS selector, you can add it to the safelist.

purgecss --css css/app.css --content src/index.html --safelist classnameToSafelist

You can check out my results on my website here: [bestarcadesticks.com](https://www.bestarcadesticks.com/)

If you need more info go check out PurgeCSS here: [purgecss](https://purgecss.com/)
Gwion changes home! (aka growing from hacktoberfest)
Tags: showdev, hacktoberfest, proglangdesign, gwion
Published: 2020-10-18 19:53:21

A few years ago, I started writing a programming language to help me in various musical tasks: I loved [chuck](http://chuck.stanford.edu/) so much, but I came to a point where it was not that *usable* in terms of performance, so I decided to make my own.

It was a great opportunity to learn about more programming and to add a few feature if missed (sometimes badly) in chuck: things like function pointers and generics, to start with.

It all finally came to the point where a [team](https://github.com/orgs/Gwion/teams/main) built and, Hacktoberfest helping, I had to move all that work on the [organization](https://github.com/Gwion) account.

In the end, I think and hope it'll help [this project](https://github.com/Gwion/Gwion) grow, become more and more usable and build its community.

-----
Don't forget is still hacktoberfest, and you can contribute this project! A summary on all issues can be found [here](https://github.com/Gwion/Gwion/issues/195).

If you are interrested in participating in Gwion's developement project, please comment [here](https://github.com/Gwion/Gwion/issues/180), we will be happy to invite you.
Hating Monday
Tags: career
Published: 2020-10-18 19:42:36

The Monday terror intensifies as the weekend nears, the uneasiness reaches its peak on Sunday. Instead of being cheerful, the weekend slips away by dreading the inevitable day. The mere thought about it breaks the brittle bliss house that I hope to stay in on weekends. I wonder why do I hate it so much.

I love writing computer programs and build cool things. I am doing what I always wanted to do - _follow my passion_. I thought building my career around my passion would be great as it is the holy grail that everybody seeks, after all, you know the quote -  
_"Do what you love, and you'll never work another day in your life"_

I recently came across interesting research done by [HuffPost Australia](https://www.huffingtonpost.com.au/2017/10/18/weve-broken-down-your-entire-life-into-years-spent-doing-tasks_a_23248153/) about the total percentage of time an average individual spends on throughout their life. Being "in bed" tops the chart, "work" comes in at second place chomping 24% of your entire life. The percentage would soar if you counted the entire workdays (Monday to Friday) as work, because even though you are physically "done for the day", the mind isn't at ease.

I wonder what change brought forth this hate for office work, or should I say the lack of change thereof? This is not a blog post about questioning the purpose of life, rather making the 24% of it less miserable.

The sole purpose of working is to earn money which would then be used to buy happiness. We work by the framework defined by the society we live in, mostly 9-5 from Monday to Friday. We follow this system (loop) throughout our life, chasing wealth which would supposedly buy happiness.

What brings happiness to me are the small things that I would do for joy and not for the sake of money, computer programming was one of them. Doing the same thing as part of my job doesn't bring the same pleasure as before. Even though career-wise I'm doing good, at least for me putting my passion in a 9 to 5 box has surely made it to fade.

If you have reasons to hate Monday, please share in the comments.
Successfully completed Hacktoberfest 2020
Tags: hacktoberfest, hacktoberfest2020
Published: 2020-10-18 19:15:15

## What I Learned From Hacktoberfest
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ukgqa69gtrv1wjm3mcqk.jpeg)
Contributing to Hacktoberfest was an amazing experience. This year was the first time I was participating in the event and it was a good learning opportunity. I got introduced to open source technologies and also met some amazing people who helped me in my contributions. Kudos to Digital Ocean, Intel, and Dev for organizing this event and all the participants for completing it with honesty.
Looking forward to continue contributing to Open Source Software in the future. 
Do let me know the contributions you made this year and how they impacted you.
Docker-compose file for php development
Published: 2020-10-18 19:09:58

---
title: Docker-compose file for php development
published: true
description: 
tags: 
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/fx0bxlvj69algrauqasu.png
---

I'm starting to learn PHP in deep in these days, so i needed a small docker-compose file to create a small container that have the most essentials requirements for my PHP learning path.

* PHP
* MySQL
* PhpMyAdmin


So here is the `docker-compose.yml` file  for anyone you all to get up fast and easy docker container to test or develop in PHP.

```yaml
version: "3.7"

services:
    php:
        image: php:7.2-apache
        ports: 
            - 8000:80
        volumes: 
            - ./www:/var/www/html
    database:
        image: mysql
        environment: 
            MYSQL_ROOT_PASSWORD: root
            MYSQL_USER: leamsigc.com
            MYSQL_PASSWORD: leamsigc.com
            MYSQL_DATABASE: leamsigc.com
    php-admin:
        image: phpmyadmin/phpmyadmin
        ports: 
            - 8001:80

```



{% gist https://gist.github.com/leamsigc/68d3f891d9298c35de273caa2b21e453 %}
JoinUs Form/embedding in a landing page! 
Tags: javascript, html
Published: 2020-10-18 19:01:07


Hello everyone, 

I'm trying to embed this Signup Form using HTML & Javascript, I got the template from Bootstrap. 

I'm having trouble to get the field_margin right through Mailchimp. 

The only data that passing is the mail address. So no ( FNAME & LNAME )

Please keep on mind, I'm a beginner and studying the web development it was a real challenge for me being dyslexic. 

Can someone tell me how I can solve this problem? 

Please see the JV code below! 

Many thanks 

CODE: __________________________________________________________________________

const express = require("express");
const bodyParser = require("body-parser");
const request = require("request");
const https = require("https");


const app = express();

app.use(express.static("public"));

app.use(bodyParser.urlencoded({
  extended: true
}));


app.get("/", function(rec, res) {
  res.sendFile(__dirname + "/signup.html");
});

app.post("/", function(req, res) {

  const firstName = req.body.fName;
  const lastName = req.body.lName;
  const email = req.body.email;

  const data = {

    members: [{
      email_address: email,
      status: "subscribed",
      marge_fields: {
        FNAME: firstName,
        LNAME: lastName,
      }
    }]

  };

  const jsonData = JSON.stringify(data);
  const url = "https://us2.api.mailchimp.com/3.0/lists/XXXXXXX";
![Screenshot 2020-10-18 at 20.48.00](https://dev-to-uploads.s3.amazonaws.com/i/fkkt2s4bmo6nutopj06q.png)
 
  const options = {
    method: "POST",
    auth: "Imminxxxxx:XXXXXXXXXXX1b8fc263aaaf-us2",
  }

  const request = https.request(url, options, function(response) {

    response.on("data", function(data) {
      console.log(JSON.parse(data));
    })
  })

  request.write(jsonData);
  request.end();

});

app.listen(3000, function() {
  console.log("Server is running on port");
});
Tips For Learning How To Code
Tags: codenewbie, opensource, community
Published: 2020-10-18 18:50:03

After watching Eddie Jaoude's youtube [video](https://youtu.be/EiQ9ghz6pE0). I felt inspired to add my tips on learning how to code.

## 1. Focus on the fundamentals
 
Whatever field of software development you are learning fundamentals are important! We use a lot of abstractions. Work on what is the core of the idea/tech. i.e. Front end Development - HTML5, CSS, JavaScript(Vanilla). These core skills keep you library and framework agnostic. Allowing you to quickly move to another technology

## 2. Solve Problems

Solve Problems - solve all the problems. Start small - no need to start using Leetcode right away. Start off with codewars or edabit. The more problems you solve the better you will be.

## 3. Make Practice Projects

Just watching tutorials doesn't help you. You need to do something with it. Make a small application on the core ideas. Doesn't matter if your learning how to use `console.log` or neural networks. Do this **2-3 times**. Don't move on until you have mastered the idea/concept. Put the best of the 3 projects in a learning path GitHub repository. This helps with getting a small portfolio together.
Setup VSCode With REACT_EDITOR  (Or Any Editor)
Tags: vscode, react, javascript, productivity
Published: 2020-10-18 18:49:05

When an error occurs with an app Created with Create React App the error screen is super helpful.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/vfgtqx7ptekd1tnwi4pn.png)

You can even click on the errors in the browser to jump directly to the line of code inside your editor! But you have to setup your editor else you'll see the error below.

Console Error:
```
Could not open SomeFile.js in the editor.
To set up the editor integration, add something like
REACT_EDITOR=atom to the .env.local file in your project
folder and restart the development server.
Learn more: https://goo.gl/MMTaZt
```

So how you setup VSCode with REACT_EDITOR?

Step 1) Setup your editor to be open from terminal

For VSCode, open the command pallet ( Command Key + P ) and type ...
[Continue Reading](https://blog.jstassen.com/2020/10/setup-vscode-with-react_editor-or-any-editor/)
CSA String Class
Published: 2020-10-18 18:46:15

The String Class is used to print long lines of characters. They are constant meaning that their values can not be changed after they are created. Since strings cannot be changed, or are immutable, they can be shared. The string class can be used to do many things with its methods including examining individual characters of a sequence, for comparing strings, for searching strings, for extracting substrings, and for creating a copy of a string with all characters translated to uppercase and lowercase. There are two was to create a string in java String literal: String s = "example"; and Using new keyword: String s = new String ("Example");. In the java language there is special support for the string concatenation operator (+), and for conversion of other objects to strings. It is implemented through the StringBuffer class. String  conversions are implemented through the method toString, defined by Object and inherited by all classes in Java.

Some examples of Constructors:
public String() = Allocates a new String containing no characters
public String(String value) = new string that contains the same sequence of characters as the string argument

Sources: 
https://courses.cs.washington.edu/courses/cse341/98au/java/jdk1.2beta4/docs/api/java/lang/String.html
https://www.geeksforgeeks.org/string-class-in-java/
https://beginnersbook.com/2013/12/java-strings/