DEV Community

MurrayVarey
MurrayVarey

Posted on

What's Been Your Biggest "Why Didn't Someone Tell Me" Discovery?

Have you ever made a discovery that blew your mind (in a good way)? Something that quickly solved a nagging problem, or perhaps something that you'd been doing wrong for years?

Tech and/or non-tech answers are all good.

Latest comments (52)

Collapse
 
thatblairguy profile image
That Blair Guy

Huge thing for me was learning how to put the output from the command line directly to the clipboard without going through an intermediate temp file.

Windows: some_command | clip
MacOS: some_command | pbcopy

(For Linux, I believe xclip is popular, but I'm not completely sure.)

Collapse
 
lathanao profile image
Lathanao

For me, that was the reverse-i-search in linux terminal. Ctrl + r then type a key word.

E.g.
Ctrl + r then type php, will find in my history: /bin/systemctl restart php-fpm.service

I use it dozens of times every day.

Collapse
 
chayandatta profile image
Chayan Datta

yea sorry, I meant shift

Collapse
 
antonellopasella profile image
Antonello Pasella

The real mean of “session” in sessionStorage.
It’s not about “session” but “tab”.

Collapse
 
dana94 profile image
Dana Ottaviani

Ctrl + f to search for word(s) on a page. I actually learned about this on a food blog. I thought it was old news but I find myself still telling people about it.

Collapse
 
robinscodeongit profile image
robin

For me the most recent thing was CTE's (Common Table Expressions), best way to make SQL readable, instead of ugly encapsulation of every sub select you can give it nice names and easy structure.
here an example:

with my_cte as
(
select id, t.* from some.table t where
),
2nd_select as
(
select fk_id as id, t.* from awesome.table t
)
Select * from my_cte a
Inner join 2nd_select b on a.id = b.id

Collapse
 
abrahambrookes profile image
Abraham Brookes

Being able to load keymappings into VScode - I come from Notepad++ and love my ctrl+d to duplicate and ctrl+shift+up/dn arrows to move lines about. If you're using VScode and you've come from another editor, check the plugins! There's very likely a keymapping plugin to make the whole way more familiar.

Collapse
 
craicerjack profile image
Carlos

This is what enabled me to move to vscode without losing my mind. Moved from Sublime and moved all my keymappings over

Collapse
 
buinauskas profile image
Evaldas Buinauskas

Being able to position cursor on multiple lines at the same column position and then type in those lines. It's been a life saver.

Collapse
 
cydstumpel profile image
Cyd

Using Cmd + ctrl and the arrows to move an entire line of code (Or selected text) in atom, I believe it’s alt/option in vscode. I always blow interns’ minds with that haha.

Collapse
 
jbradford77 profile image
Jennifer Bradford

Windows button and L locks your computer and ctrl alt left turns your screen rightways back up when your toddler button mashed your laptop screen sideways

Collapse
 
murrayvarey profile image
MurrayVarey

"Keyboard Shortcuts for When Your Toddler Button Mashes Your Laptop" could be an entire genre in itself!

Collapse
 
kosich profile image
Kostia Palchyk

Vim. Vimium for chrome. Vimperator for FF. Vim for VS Code 🙌

Collapse
 
jappyjan profile image
jappyjan

I just found out that there is a good alternative to jira worth to look at... Even worth to switch to!

Clubhouse.io

Always thought there is no such thing as a good and complete alternative to the whole atlassian family which I never quite liked...

Collapse
 
chayandatta profile image
Chayan Datta • Edited

For me, when writing something -> to select more than one word or line, without dragging the mouse pointer the whole time,

just keep the typing bar on starting point and click the ending point with a shift

it just changes everything

Collapse
 
murrayvarey profile image
MurrayVarey

Did I know this? Honestly, I'm not sure. I'm certainly going to start using it now. Thanks!

Collapse
 
damjand profile image
Damjan Dimitrov

That dragging the middle mouse button in VSCode lets you add multiple cursors on different lines and/or select just a portion of a text on multiple lines at the same time.

Collapse
 
murrayvarey profile image
MurrayVarey

Yeah, that's a nice one. Did you see @peacefullatom 's Visual Studio Productivity post yesterday? Well worth a read.

Collapse
 
peacefullatom profile image
Yuriy Markov

Here's one more trick. Select portion of text and press Ctrl + Shift + L - this will select all fragments within opened document, this you can edit them all at once 🙃

Collapse
 
kuerbisulme profile image
Simon

Finding out that you can assign an alias to search engines in Chrome and use tab in the address bar to switch to "search mode" was pretty nice. In combination with Ctrl + L I focus the address bar, type yt, press tab, enter my search term, press enter and Chrome takes me to youtube which then will present the search results :)

Collapse
 
murrayvarey profile image
MurrayVarey

That's a nifty trick. I'll give that a whirl!