DEV Community

Cover image for April 9th, 2021: What did you learn this week?

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

Nick Taylor on April 09, 2021

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. ![It’s time ...
Collapse
 
idrisrampurawala profile image
Idris Rampurawala • Edited

Recently, while working on one of my tasks to process a very large AWS S3 file, I came across this really good AWS S3 select feature. This helped me accomplish my task and decided to share my learnings with the community 😁

Hope the community finds it an interesting read 🙏

Collapse
 
nickytonline profile image
Nick Taylor

Yeah!

A T-Rex saying Yeah!

Collapse
 
idrisrampurawala profile image
Idris Rampurawala

@nickytonline thanks 😁 The king of gifs on dev.to 🤭

Collapse
 
vonheikemen profile image
Heiker • Edited

vim has an easy mode. You enable it by using -y flag, like this vim -y. Is kinda cool, it makes it behave like a regular "click-and-type" text editor. In this mode regular shortcuts work as expected, ctrl + s for save, ctrl + c for copy, ctrl + v paste, ctrl + z to undo, ctrl + y redo.

The downside (and the reason nobody makes a big deal about it) is that is was designed to be used inside a GUI, so no shortcut to quit. You need to close whatever graphical interface vim is in.

Not all is lost, I think it provides a nice base to use vim for quick edits. For the people who will never use vim on purpose, I will recommend creating a .vimrc on their home folder with this content.

" Enable 'easy mode'
source $VIMRUNTIME/evim.vim

"  Ctrl + q to Quit vim
inoremap <c-q> <c-o>:q<cr>
Enter fullscreen mode Exit fullscreen mode

This will create a ctrl + q shortcut to quit. You could also replace (or add) <Esc> as a shortcut to quit.

This way even if you enter vim by accident it will behave somewhat like a "normal" text editor.

Collapse
 
nickytonline profile image
Nick Taylor

Awesome!

Hackerman from Kung Fury putting on a Nintendo Power glove

Collapse
 
stephanieopala profile image
Stephanie Opala

I learned state management in React, useState to be specific.

Collapse
 
voralagas profile image
Pravin Poudel

Same here, It was interesting to learn that, and now the state is available on functional component too. I found it quite easy handling with a hook rather than in-state in-class component. I haven't done much but I hope I am not wrong.

Collapse
 
stephanieopala profile image
Stephanie Opala

Me too, so far I find it easier to use hooks rather than in-state in class components.

Collapse
 
nickytonline profile image
Nick Taylor

Pam from The Office saying Nice!

Collapse
 
djuber profile image
Daniel Uber

I learned that ruby ships with a .gdbinit file in the source repo, that permits inspecting the class/objects in the internals, basically handling the unpacking of the tagged ids for you, and saving the results as history items.

Of course I learned that after searching a few locations for "how to debug ruby" and finding a mix of snippets, most attributing a blog that's been offline for a year or two as the source, and a lot of two paragraph "here's how to start gdb" tutorials.

Kind of handy to have the tooling to debug the vm ship with the language sources!

Collapse
 
nickytonline profile image
Nick Taylor

Jean-Luc Picard from Star Trek TNG saying Well done!

Collapse
 
cassidycodes profile image
Cassidy

I learned how to use GitHub's Scientist gem, and ran my first experiment on a weird trick for (sort of) speeding up ORDER BY.

dev.to/cassidycodes/one-weird-tric...

Collapse
 
nickytonline profile image
Nick Taylor

BB-8 giving a thumbs up

Collapse
 
leob profile image
leob • Edited

I learned something yesterday which for me was a pretty "weird" discovery:

If you use CSS Flex and you want to (for example) right-align one particular item (while leaving the rest "default"), then guess what you can use ... "margin-left: auto"!

Pretty surprising, to me at least. More info here:

dev.to/samanthaming/flexbox-aligni...

Well so that wasn't what I expected really, I was looking for something like "align-self" or "justify-self" or whatever ...

Speaking of which - I can never remember which is which ("align-items" or "justify-content"), and I finally came across a way to somewhat easily remember which is which:

css-tricks.com/a-quick-way-to-reme...

Collapse
 
nickytonline profile image
Nick Taylor

Captain America saluting

Collapse
 
atulcodex profile image
🚩 Atul Prajapati 🇮🇳
Collapse
 
nickytonline profile image
Nick Taylor

Nice!

A kangaroo playing an electric guitar

Collapse
 
atulcodex profile image
🚩 Atul Prajapati 🇮🇳

:)

Collapse
 
juniordevforlife profile image
Jason F • Edited

I used the !! operator for the first time. I used it in a ternary and it looks something like this:

const myValue = !!thing.val ? thing.val : '';

Collapse
 
nickytonline profile image
Nick Taylor • Edited

Boolean magic!

Shia LeBoeuf in character saying "Magic!"

Collapse
 
matthewbdaly profile image
Matthew Daly

Today I started using Snowpack. I'm seeing really fast build times for React applications with it - even on a creaky old laptop adding a new Tailwind class is basically instantaneous.

Collapse
 
nickytonline profile image
Nick Taylor

A puppet Yeti clapping their hands saying congratulations

Collapse
 
voralagas profile image
Pravin Poudel

This week I learned about React Hook, more about reference and reference forwarding in React.

Collapse
 
nickytonline profile image
Nick Taylor

Nice!

Actor from Game of Thrones saying Nice!

Collapse
 
pranavbaburaj profile image
Pranav Baburaj

I've been trying to learn some zig

Collapse
 
nickytonline profile image
Nick Taylor

Actor Zach Galifianakis giving a thumbs up in a convertible car

Collapse
 
kirkcodes profile image
Kirk Shillingford • Edited

I learn about using graph theory to solve problems!

dev.to/kirkcodes/solving-the-domin...

Collapse
 
nickytonline profile image
Nick Taylor

Charlie from It's Always Sunny in Philadelphia talking in front of a board with all kinds of strings and arrows depicting something very complicated

Collapse
 
sunilkumarvalmiki profile image
g.sunilkumar

this week, i learnt 3 new courses :
1) Express REST API
2) Introduction into micro-services
3) mind mapping techniques for better learning.

Collapse
 
nickytonline profile image
Nick Taylor

Lego astronaut saying awesome!