DEV Community

Cover image for June 16th, 2022: What did you learn this week?
Nick Taylor
Nick Taylor Subscriber

Posted on

June 16th, 2022: 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.

![Image of the brain](https://media.giphy.com/media/ojmB7lOn3VUU8/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.

Top comments (24)

Collapse
 
jonasbn profile image
Jonas Brømsø

You can specify files to be ignored by Dropbox, very useful for folders like node_modules and similar.

I did a brief write up in my TIL collection.

Collapse
 
jonasbn profile image
Jonas Brømsø

Oh yeah and I located the Wiki with all of the rules for shellcheck so it will be faster to access the documentation for the specific rules as I am adopting use and making adjustments to some of all my Bash scripts.

Collapse
 
nickytonline profile image
Nick Taylor

A basketball player with cool sunglasses rotating left and right with the caption FABULOSO

Collapse
 
deciduously profile image
Ben Lovy • Edited

Cute trick to inspect your C compiler configuration:

$ gcc -x c -v -E /dev/null
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-libstdcxx-backtrace --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-12.1.1-20220507/obj-x86_64-redhat-linux/isl-install --enable-offload-targets=nvptx-none --without-cuda-driver --enable-offload-defaulted --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux --with-build-config=bootstrap-lto --enable-link-serialization=1
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.1.1 20220507 (Red Hat 12.1.1-1) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-E' '-mtune=generic' '-march=x86-64'
 /usr/libexec/gcc/x86_64-redhat-linux/12/cc1 -E -quiet -v /dev/null -mtune=generic -march=x86-64 -dumpbase null
ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/12/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/12/../../../../x86_64-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-redhat-linux/12/include
 /usr/local/include
 /usr/include
End of search list.
# 0 "/dev/null"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "/dev/null"
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/12/:/usr/libexec/gcc/x86_64-redhat-linux/12/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/12/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/12/:/usr/lib/gcc/x86_64-redhat-linux/12/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/12/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-E' '-mtune=generic' '-march=x86-64'
Enter fullscreen mode Exit fullscreen mode

You can get just the configuration with a plain gcc -v, but by invoking the preprocessor with -E and pointing it at some nonsense /dev/null, you additionally get to inspect the paths it will use for looking up libraries. Because you passed in something nonsensical, it can't determine what sort of compilation you're doing, so you have to explicitly specify with -x c. This forces it to attempt to preprocess the input as a C program which provides the most complete set of information. Works with clang too.

Handy!

Collapse
 
nickytonline profile image
Nick Taylor

Awesome!

Hackerman from Kung Fury putting on a Nintendo Power glove

Collapse
 
ahmad_butt_faa7e5cc876ea7 profile image
Ahmad

I learned how easy it is to make slider menus for webapps!

I was using a library for a react component and it was working great locally but it broke when i was getting folks to test my app : iwannagoapp.com/ (just launched btw , would really appreciate any feedback)

After looking around for a solution, i found a great article with a dozen css lines which just worked

lesson learned: CSS trumps complicated Javascript components any day all day for styling and animation

heres the link to the article:
kirupa.com/react/smooth_sliding_me...

Collapse
 
nickytonline profile image
Nick Taylor

That's awesome! 🔥

Yes, that's awesome!

Collapse
 
snikhill profile image
Nikkhiel Seath

I was going to optimise a piece of code and learnt to never optimise per-maturely.

Always make sure that you keep context in mind when optimising.
O(n) + O(n) where n is just 10 is alright and won't make much of difference if you spend time and make the heuristic O(n).

I am just curious to know, @nickytonline what are you learning these days?

Collapse
 
nickytonline profile image
Nick Taylor

It's True - Dwight Shrute

For myself, I'm learning Affinity Designer.

Collapse
 
pontakornth profile image
Pontakorn Paesaeng

I got to use svelte-i18n. It's OK.

Collapse
 
nickytonline profile image
Nick Taylor

Nice!

Nice

Collapse
 
ben profile image
Ben Halpern

Lol

Collapse
 
atulcodex profile image
🚩 Atul Prajapati 🇮🇳

Just started learning ui design principles 🤞

Collapse
 
nickytonline profile image
Nick Taylor

Yeah!

A T-Rex saying Yeah!

Collapse
 
mjcoder_5 profile image
MJCoder

I've learnt using some pre-built themes can come to bite you in the backside!

Collapse
 
nickytonline profile image
Nick Taylor

Dwight Shrute from the Office screaming fireball as he throws an imaginary fireball from his hands

Collapse
 
dhanushkadev profile image
Dhanushka madushan

Updated my GitHub profile readme with some of few widgets

github.com/madushadhanushka/simple...

Collapse
 
nickytonline profile image
Nick Taylor

Stephen Colbert saying Awesome Sauce

Collapse
 
nickytonline profile image
Nick Taylor

Captain America saluting

Some comments may only be visible to logged-in visitors. Sign in to view all comments.