DEV Community

Cover image for September 9th, 2021: What did you learn this week?
Nick Taylor
Nick Taylor Subscriber

Posted on

September 9th, 2021: What did you learn this week?

It's that time of the week again. So wonderful devs, what did you learn this week? It could be programming tips, career advice etc.

![A picture it a dog waving their paw with the caption “Learning, cool at school or at home”](https://media.giphy.com/media/1xpm1nTQiRL96Di3Q6/giphy.gif)

Feel free to comment with what you learnt and/or reference your TIL post to give it some more exposure.

#todayilearned

Summarize a concept that is new to you.

And remember, if something you learnt was a big win for you, then you know where to drop it as well.👇👇🏻👇🏼👇🏽👇🏾👇🏿

![Drama from Entourage screaming “Victory!”](https://media.giphy.com/media/lnlAifQdenMxW/giphy.gif)

Oldest comments (29)

Collapse
 
vonheikemen profile image
Heiker • Edited

I learned about envsubst. I wish I knew about this before. This utility can substitute environment variables in a string that come from stdin.

I don't have many use cases for this but I think it would be very useful in config files that I share across multiple machines.

Quick example. Somewhere in a github repo I have a file called .npmrc, which I copy to any new machine I get. Inside that file I have this.

prefix=/absolute/path/to/npm/packages
Enter fullscreen mode Exit fullscreen mode

I don't like it, I want to replace that absolute path with this.

prefix=$XDG_CONFIG_HOME/npm/packages
Enter fullscreen mode Exit fullscreen mode

So, what I can do is create a template file and then create .npmrc from that.

envsubst < ~/templates/npmrc > ~/.npmrc
Enter fullscreen mode Exit fullscreen mode

The result on linux should be this:

prefix=/home/user/.config/npm/packages
Enter fullscreen mode Exit fullscreen mode

And if I wanted, I think I could use curl to fetch the content of the file and then pipe it to envsubst. So technically I don't even need the template in my filesystem.

EDIT: Yes, curl works like a charm.

curl -s "https://raw.githubusercontent.com/<my-user>/<some-repo>/main/npmrc" \
  | envsubst > ~/.npmrc
Enter fullscreen mode Exit fullscreen mode
Collapse
 
nickytonline profile image
Nick Taylor

Nice!

A kangaroo playing an electric guitar

Collapse
 
peter279k profile image
peter279k

I learn how to use the Firebase and Google Cloud Function to deploy my web crawler and let my web crawler be a API service on the FaaS computing :).

Collapse
 
nickytonline profile image
Nick Taylor

Awesome!

Hackerman from Kung Fury putting on a Nintendo Power glove

Collapse
 
jonathanyeong profile image
Jonathan Yeong

Learning about Character Encoding for strings! Here's a snippet from my permanent note:

Every character that we see is represented as a number on the computer. To be specific, it's a series of bits. But this process of transforming a visual character into a number is done through character encoding. Character encoding is a map for the computer to transform this number into the character we see. It's a cipher, a key, to crack the code.

Collapse
 
nickytonline profile image
Nick Taylor

Shia LeBoeuf in character saying Magic!

Collapse
 
behnoodeghbali profile image
Behnood Eghbali • Edited

I learned how to fetch URLs and how to write HTTP web services in Go. Here's an interesting talk by Mat Ryer about writing HTTP web services at GopherCon 2019: youtube.com/watch?v=rWBSMsLG8po

Collapse
 
nickytonline profile image
Nick Taylor

Noice!

Noice!

Collapse
 
eddyvinck profile image
Eddy Vinck

I learned how much work it really is to launch a product. I also learned how addictive it is to get Gumroad sales notifications while sleeping or working my job 😆

Collapse
 
nickytonline profile image
Nick Taylor

A crab dancing

Collapse
 
vaibhavkhulbe profile image
Vaibhav Khulbe

Just started with TypeScript! I am doing it all with its docs. It's well written and easy to consume if you have a good JS knowledge :)

Collapse
 
nickytonline profile image
Nick Taylor

Nice!

Nice

Collapse
 
ifierygod profile image
Goran Kortjie

I learned that it takes one hour everyday for several months to actually understand something.

Collapse
 
nickytonline profile image
Nick Taylor

Let's go!

A kid twirling in a cowboy outfit firing pistols that are their fingers

Collapse
 
rakeshsagar64 profile image
Rakesh Sagar

I learnt some interesting things about mysql here's the link to the lazily written post about it.
dev.to/rakeshsagar64/til-mysql-stu...

Collapse
 
nickytonline profile image
Nick Taylor

BB-8 giving a thumbs up

Collapse
 
seankimdev profile image
Sean Kim

I learned to use Material UI. A quick and simple way to style a React app.
It took some time getting used to its setup, but definitely worth it. The tutorial video below by The Net Ninja helped a lot.

m.youtube.com/playlist?list=PL4cUx...

Collapse
 
nickytonline profile image
Nick Taylor

Hot Rod saying Cool beans!

Collapse
 
piratax007 profile image
Fausto Mauricio Lagos Suárez • Edited

I learned about assert statements and decorators. The first one is such a tool to debug your code and the second one is a way to modify an object, function or method without altering his code. Decorators are a wonderful way to reuse code adding functionalities.

Collapse
 
nickytonline profile image
Nick Taylor

Actor Leonardo DiCaprio as Gatsby doing a cheers