teleren/devto huggingface dataset:
Getting Started with Node.js
Tags: opensource, beginners, html, codenewbie
Published: 2021-03-07 16:49:23

I hope you guys enjoyed my last post on transparent simple html form. In this post we will talk about one of the most popular backend server environment.

**What is Node.js?**

Node.js is an open-source, cross-platform, JavaScript runtime environment that executes JavaScript code outside of a web browser.

Node.js runs single-threaded, non-blocking, asynchronously programming, which is very memory efficient.

**Use Cases of Nodejs:**
1. Real-Time Apps
2. Data-Intensive Apps
3. To build Scalable Backend
4. Non-Blocking Asynchronous Thread

**Getting Started**

Now after downloading Nodejs on the computer let's try to create hello world program. Remember, Node.js files must be initiated in the "Command Line Interface" program of your computer. For Windows users, press the start button and look for "Command Prompt", or simply write "cmd" in the search field.

```
var http = require('http');

http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/html'});
  res.end('Hello World!');
}).listen(8080);
```
You can choose any port available on computer to listen. 
Now start your command line interface, write node myfirst.js and hit enter:
` C:\Users\User Name>node myfirst.js  `

Now let's try to understand the terms in our first program.

 **Modules(require):**

A set of functions you want to include in your application.
Node.js has a set of built-in modules which you can use without any further installation.
 * To include a module, use the require() function with the name of the module.
 `var http = require('http');`

 * The first argument of the `res.writeHead()` method is the status code, 200 means that all is OK, the second argument is an object containing the response headers.

Now your application has access to the HTTP module, and is able to create a server.

``` 
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/html'});
  res.end('Hello World!');
}).listen(8080);
```
So this was the introduction to Nodejs using simple Hello World program.

Most of the contents pf this post are from w3schools.com so for any elaborated information you can https://www.w3schools.com/nodejs/nodejs_intro.asp refer this page.
I hope it will help you to quickly get started learning Node.js.

Happy Coding!!...
The Year I Finally Went After My Goals
Tags: wecoded, devjournal, showdev
Published: 2021-03-07 16:47:14

Although I think that I still have a long way to go, I feel inspired by others in the community and I hope I can inspire others as well to write their stories or go after their goals. So, I decided to participate and share my story.

---

## The Year I Finally Started Writing

I've always wanted to start a tech blog. However, I always felt intimidated and scared that my articles wouldn't be good enough or that I need to be at a certain level of expertise to be able to start one. 

I decided to finally do it at the end of last year, then I stopped for a while due to some negative criticism. Then again I plucked up my courage this year and tried again, and thankfully I have been going strong and receiving a lot of comments that it has helped others. This has encouraged me to keep sharing my knowledge, and even learn more to share with others as well. I started learning new technologies and participate in certain challenges, then share what I learned.

---

## Managing Open Source Projects

I also always wanted to contribute to open-source projects, but I felt unsure of where to start or how. So, in late September last year, I started my first open-source project [sButtons](https://github.com/sButtons/sbuttons) and I've learned so much from it. I started it as a way to help other beginners to open source as well and working with the community has been motivating to keep improving myself. This encouraged me to start other open-source projects as well and gave me confidence.

---

## Publish NPM packages

I've been able to publish 2 NPM packages recently, one for sButtons and one for [use-dark-mode-hook](https://www.npmjs.com/package/use-dark-mode-hook) for React. I gained courage due to the points I mentioned above. 

---

## Take On More Responsibilities At Work

I've been working at my current job for almost 3 years now, and this year I gained the courage to take on more responsibilities, managing aspects of projects and working in different technologies. I used to feel like my opinions wouldn't matter much, or I would be saying the wrong things, but as I started speaking up more I realized the power of my voice and that I could do and be more.

---

## The Year I Found My Passion

Although I've been working for many years now as a developer, it wasn't until this year that I started going after my goals, learning more technologies, and trying harder to improve myself and help others as well. After starting my blog and managing open source projects, I realized that this is not a job for me, this is a passion. I feel happy creating something new, solving problems, and connecting with the community as well.

Last, I would like to thank any person who has said any encouraging or nice words to me, as it helped me keep going as well.

Follow me on Twitter on [@shahednasserr](https://twitter.com/shahednasserr).
Follow me on [GitHub](https://github.com/shahednasser)
Check out [my blog](http://blog.shahednasser.com/)
no pg_hba.conf entry for host heroku
Published: 2021-03-07 16:46:57

After searching a lot on internet about this problem, finally I found a solution on documentation: 

Create a ./config/env/production/database.js file containing the following code:

const { parse } = require("pg-connection-string");

module.exports = ({ env }) => {
  const { host, port, database, user, password } = parse(env("DATABASE_URL"));

  return {
    defaultConnection: "default",
    connections: {
      default: {
        connector: "bookshelf",
        settings: {
          client: "postgres",
          host,
          port,
          database,
          username: user,
          password,
          ssl: { rejectUnauthorized: false }
        },
        options: {
          ssl: false
        },
      },
    },
  };
};

doc: https://strapi.io/blog/deploying-a-strapi-api-on-heroku
Day58,59,60:100DaysOfCode
Tags: 100daysofcode, programming, productivity
Published: 2021-03-07 16:44:58

gave cf contest div2 solved 1 ques completely..
did some greedy problems on codeforces and leetcode


practised segmented sieve questions on spoj,
constructive algo problems on leetcode and cf.
studied prob and statistics further on topcoder

practised ncr combinations on gfg and leetcode

took a greedy session today on 

You can Follow me->
https://github.com/singhtaran1005
https://www.linkedin.com/in/taranpreet-singh-chabbra-27517918a/
Nevertheless, She choose to challenge and coded. ✨
Tags: wecoded, choosetochallenge, womenintech
Published: 2021-03-07 16:31:04

##How it all started 
Last year a time like this I didn't know how to code. But through a video I watched of how amazing women became self-taught developers, I decided to look around and use resources I could find. To be honest, at first, I was going in blind because I didn't have anyone in the tech industry. But a YouTube recommendation from [The come up about how to be a self-taught software engineer](https://youtu.be/2i3v1BbKbs8) completely changed my view. 
When I told my friends and family that I wanted to change careers to tech, I could see the doubt and resistance in their eyes. Going to campus is the conventional route. My path of being self-taught was crazy and an illusion to them. But I do understand them, they love the safer route but to me, going back to Uni wasn't doable financially. I started using free resources like FreeCodeCamp to get me started. At the same time, I joined Dev to get more insight and got inspired by [Lydia Hallie](https://dev.to/lydiahallie) and the [ladybug 🐞 podcast team of engineers](https://dev.to/ladybug). They truly shed light 🔆 on how to get started in the industry and how to change careers. That's how it all started, yes from a YouTube recommendation. 😁 

## My most recent achievement was…
I was able to join a small start-up that's passionate about code and they have now become my inspiration in the industry. 
I didn't expect to have a place there at first but they are so encouraging and help me along the way. As the only female web developer on the team, it made me want to work harder and bring more female engineers to the team. 

## My biggest goal is…
To inspire more youth around my community to join the tech industry. I believe anyone can do it, it's just a matter of finding someone who can guide along the way. Bringing more information on how to be a self-taught developer will change someone's life one day. Being part of that will be my greatest joy this year. 

## My advice for allies to support underrepresented folks who code is...
Always stand up for those who can't speak up for themselves. Be their voice and work together for a better environment that's positive and supports all. 

#### In Conclusion
I didn't want the post to be lengthy but I hope someone will be inspired by it. I believe we all have a part to play in this life, you can be someone's inspiration or role model without you knowing it. Keep pushing and keep fighting for your dreams. All it takes is taking the first step and working hard for what you want.  
<img src="https://i.ibb.co/G9YVKMD/giphy-2.gif" alt="giphy-2" border="0">
Nevertheless, Dana Ottaviani coded.
Tags: wecoded
Published: 2021-03-07 14:37:38

<!-- ✨This template is only meant to get your ideas going, so please change/add/remove these prompts as you wish! We also encourage you to create your own title if you’d like! ✨ -->

## My most recent achievement was:

Finding a job at the start of 2021. I strongly dislike the different hoops someone needs to jump through to apply to jobs. The endless questionnaires, cover letters that some people claim don't get read anyway, uncompensated take-home projects no-one has time for, timed challenges,  etc. I once got a reply to a job application almost a year later. :confused: I seriously don't know what the next interview process will be like.

## Advocating for myself looks like:

Speaking to my manger when something bothers me or I don't feel like my position in the company is safe. I think it's from my experience in other companies, but I am very hyper sensitive to people's reactions and how they speak to me.

It is mentally draining to feel like you are not seen as good as an engineer as the rest of your team and that no matter how hard you're working and how many more hours you work you still feel like none of it changes a manager's perception of you and your competency as an engineer.

<img src="https://media.giphy.com/media/du5d9o1vf2nJ8EtNUN/giphy-downsized.gif" />

<div style="width:100%;height:0;padding-bottom:51%;position:relative;"><iframe src="https://giphy.com/embed/du5d9o1vf2nJ8EtNUN" width="100%" height="100%" style="position:absolute" frameBorder="0" class="giphy-embed" allowFullScreen></iframe></div><p><a href="https://giphy.com/gifs/oscars-academy-awards-oscars-2019-du5d9o1vf2nJ8EtNUN">via GIPHY</a></p>

## My biggest goal is:

Work on more projects I can be proud of while maintaining a healthy work-life balance. 

## My advice for allies to support underrepresented folks:

Analyze what you've been doing to support minorities in tech. Have they left your company? Did you let them go because they didn't measure up to your standards? If you want them to succeed in your company, ask them how you can better support them. Do you have a careers page on your site talking about how much you value diversity and people's different backgrounds but it seems to be all talk? Work on that.

Flexible hours are also important to me. You can't expect someone in a different time zone to constantly work at the same time you are.

There is something else I want to address: recognize when you make mistakes and acknowledge them. I've had to bring up concerns about managers in previous companies and I always get praised for doing so but I feel like this happens too often and I'm tired of having to go though this experience.
Hello World
Tags: devops
Published: 2021-03-07 16:23:42

Od 10 roku życia jestem pasjonatem komputerów i programowania.
Moim pierwszym (mikro)komputerem był ZX-Spectrum a językiem programowania: Basic.
Obecnie tworzę architekturę ekosystemów dla liderów rynku w firmie Softreck
Nevertheless, Mehak Saini Coded in 2021!
Tags: wecoded
Published: 2021-03-07 16:17:34

<!-- ✨This template is only meant to get your ideas going, so please change/add/remove these prompts as you wish! We also encourage you to create your own title if you’d like! ✨ -->

### My most recent achievement was being able to share my learnings and shortcomings with the dev community on multiple social platforms. Being a total introvert, it really took me courage to take the first step outside my comfort zone.

### Advocating for myself looks like nothing less than standing for the entire women community 

### My biggest goal is to make a significant contribution to the dev world

### My advice for allies to support underrepresented folks who code is always be kind to them and support them in every possible way.
Daily Developer Jokes - Sunday, Mar 7, 2021
Tags: jokes, dailydeveloperjokes
Published: 2021-03-07 15:24:09

---
title: "Daily Developer Jokes - Sunday, Mar 7, 2021"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Sunday%2C%20Mar%207%2C%202021"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e125952bbb70.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ Where did the API go to eat?

___A:___ To the RESTaurant
 -->
Day 69 Of 100DaysOfCode: Continue Datacamp Course
Tags: 100daysofcode, codenewbie, womenintech, beginners
Published: 2021-03-07 16:04:37

This is my 69th day of #100daysofcode and #python learning. Today I spend my time in datacamp course completed assignment on it.
 
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">Day 69 Of <a href="https://twitter.com/hashtag/100DaysOfCode?src=hash&amp;ref_src=twsrc%5Etfw">#100DaysOfCode</a> and <a href="https://twitter.com/hashtag/Python?src=hash&amp;ref_src=twsrc%5Etfw">#Python</a> <br>Regex From [Datacamp](<a href="https://t.co/ZUKD3yvqEe">https://t.co/ZUKD3yvqEe</a>)<a href="https://twitter.com/hashtag/womenintech?src=hash&amp;ref_src=twsrc%5Etfw">#womenintech</a> <a href="https://twitter.com/hashtag/CodeNewbie?src=hash&amp;ref_src=twsrc%5Etfw">#CodeNewbie</a> <a href="https://twitter.com/hashtag/100DaysOfCode?src=hash&amp;ref_src=twsrc%5Etfw">#100DaysOfCode</a> <a href="https://twitter.com/hashtag/WomenInScience?src=hash&amp;ref_src=twsrc%5Etfw">#WomenInScience</a> <a href="https://twitter.com/hashtag/DEVCommunity?src=hash&amp;ref_src=twsrc%5Etfw">#DEVCommunity</a> <a href="https://t.co/SQhbMdoaX5">pic.twitter.com/SQhbMdoaX5</a></p>&mdash; Durga Pokharel (@mathdurga) <a href="https://twitter.com/mathdurga/status/1368591696389234689?ref_src=twsrc%5Etfw">March 7, 2021</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
Big useEffect mistake
Tags: react, webdev, javascript, performance
Published: 2021-03-07 15:54:47

*This post was originally posted on my personal [blog](https://bugged.dev/post/Big-useEffect-mistake).*

In Reactjs, we encountered infinite loops or useless re-rendering a lot. It's something unavoidable, but we can be more attentive about it sometimes. One of the reasons that cause us this kind of problems is useEffect; I'm going to talk about one of the mistakes we can make with it and learn how to be aware of it.

## The mistake 😮

Check this out:

```tsx
const [state, setState] = React.useState(0);
React.useEffect(() => {
  console.log("re-rendering");
}, [{ ...someData }])
```

Now if we do `setState`multiple times, we're going to see this in console:

```tsx
re-rendering
re-rendering
re-rendering
```

Wait; what? We just passed `someData` as a dependency list; why it logs that? That's not even related to `state`. Yes, it's not related, but pay more attention to the dependency list; We passed an inline object, which means it's always different from its previous version; we create it every time we cause a re-render to the component. Check this:

```tsx
{ ...someData } === { ...someData } // false
{} === {} // false
[] === [] // false
// all are inline and have different references
```

`useEffect` somehow cache the dependency list and check if it's equal to the next value. That's why inline non-primitive values (`[]`, `{}`, `{...data}`, ...) are always different in this tool's eyes.

> `Symbol()` is an exception here, it's different every time we create it, but it's a primitive value.

For example, check this, I saw many developers that they check part of an array like this:

```tsx
const [state, setState] = React.useState([1, 2, 3, 4, 5]);
React.useEffect(() => {
  console.log("re-rendering");
}, [state.slice(0, 2)]); 
/* 
	prevVal = state.slice(0, 2) // first render
		***
	nextVal = state.slice(0, 2) // second render
		***
	prevVal === nextVal // false
*/
```

The expected behaviour is checking 1 to 3 values, but it doesn't work like that because the `slice` method will always return a new array (reference).

I hope you enjoyed this article. Don't forget to share and send reactions to my article. If you wanted to tell me something, tell me on [Twitter](https://twitter.com/aslemammadam) or mention me anywhere else, You can even subscribe to my [newsletter](https://bugged.dev/newsletter) and follow me on [Github](https://github.com/Aslemammad). 👋🏻
remove the .html extension
Published: 2021-03-07 15:23:02

Just put this in your .htaccess file
```
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/$ $1.html
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]
```

https://tekniq.xyz and you can click on the month's link without the *.html showing on the url. This makes it much neater.

By the way, my blog is designed to be Lynx Browser friendly. All of my post are done by editing the html file directly. Don't want to use markdown
How I Like To Study A New Topic
Tags: learning, career
Published: 2021-03-07 15:18:11

This is a [sub-part to an article](https://dev.to/rodiwa/how-to-study-again-after-a-really-really-long-break-2l0b) I had written recently.


## List Down The Topics. Study Topic Wise Only (10% Effort)
I like to list down my topics beforehand or have them in front of me while I’m studying. Helps to categorise the content I’m reading/ viewing to be within a ‘boundary’.
## Pick A Good Video Tutorial (10% Effort)
Watching a video is much faster than reading docs. It gives you a good overview on a new subject. More content in little time.
## Don’t Always Start From The Basics
Unless it’s a brand new subject, chances are you already know this. Start from the advanced topics, or those parts that you haven’t done before.
## Go Through It Quickly (20% Effort)
Even if it’s a 40hr Udemy course or a YouTube playlist of 200 videos, I try to go through them all within 2 days. Think 1.5x or 1.75x speed. The idea is to only acquaint myself to the subject right away. If I’m stuck on a topic, I don’t waste time on it. I skip to the next section and carry on.
## Recall + Revise + Make Notes (20% Effort)
This is the meat of it all. Recalling + writing it down is like hitting a `Ctrl + S`. It stays better in memory. The notes you make are in your own words. It also doubles up for quick review before your exam/ interview. 
## Go Deep Into The Subject (40% Effort)
The subject you were stuck on earlier? This is where you find YouTube videos for that particular topic. This is where you refer the documentation for examples and explanations. Read books and PDF to be an expert. This is where you fill in the gaps.
## Practice (Maximum Effort)
There’s no way around this one. Make a GitHub project. Design, code and implement your own idea with what you’ve learnt. Document it for future references.
Emoji😊🤣 In Python
Tags: python, programming, codenewbie
Published: 2021-03-07 14:53:47

_Emoji's language is the world’s fastest-growing language and there are more than 3000 emojis. So Why not start using emoji in our python program. In this article, you will learn how to use emoji in python._

_For using emoji in python we need to install an `emoji` library, so open your command prompt and run this command._

```
pip install emoji
```
_This Command will install the `emoji` library on your computer and now you are ready to use emoji in your python program_.


This library uses an emoji cheat sheet to display emoji of that particular cheat._  [Cheat Sheet](https://www.webfx.com/tools/emoji-cheat-sheet/) 

```
>>> import emoji
#This command will import emoji library in your program
>>> print(emoji.emojize('Give a :thumbs_up: to this article.'))
Give a 👍 to this article.
>>> print(emoji.emojize('Give a :red_heart: to this article.'))
Give a ❤ to this article.
```

By default, you can only use few emojis from the  [cheat sheet](https://www.webfx.com/tools/emoji-cheat-sheet/) but for using the complete list you need to add `emoji.emojize(use_aliases=True)` in your code, this is how we do that.

```
>>> import emoji

>>> print(emoji.emojize('Are you feeling :angry:', use_aliases=True))
Are you feeling 😠
>>> print(emoji.emojize('Dont forget to wear your :mask:', use_aliases=True))
Dont forget to wear your 😷

```

_That's it for this article, this is my third article so share some feedback to improve in the comment section._