What do you Google EVERY. SINGLE. TIME. and never just memorize?
Ben Halpern
γ»1 min read
Classic DEV Post from Mar 21
Should Dev.to posts have a comment section for grammar suggestions?
Davide Bellone -
How well-received could a 16-year-old be for a web developer job??
Kumar Abhirup -
Would you buy a design system with React components?
Hunter Garrett -


128
12


Trending on
20 Most-Recommended Books for Software Developers
My Top Youtube Channels to Learn Web Development and Programming
Improve Your Git Productivity with Bash
Could your recruitment process be discouraging female developers?
Being an "old" junior dev
Why isn't Functional Programming the Norm?
Let's Talk about Movies! Part 1
How to make a tar file...
at least extracting is easy (say it in a german accent) tar -xzf "xtract ze files"
and -czf == 'compress ze files'
well what works for me is tar -xzvf "xtract ze vucking files"
No kidding that's how remember it
this...is actually brilliant! lol
That's a great way! Jajajaaj
But it's important to note that tar is smart enough to detect the format so I prefer the general
tar -vxfEven though as a German with decent English pronunciation this is a little bit insulting, I'll probably never forget this ever again. Thanks! π
Thank you so much.
Isn't that for zipped tar files? -xzf = extract zipped (tar) file.
I threw this one at a dev I used to work with. He answered instantly, he could have disarmed 2 bombs with that speed.
Instant respect gained
I figured out how to remember it. To create tar, use
coption and for extracting replacecwithx==>$tarwill remain same for both Lol :) .tar -cvf filename.tar file/dir_path&&tar -xvf filename.tar.regex
The same with me!! But I found VerbalExpressions (github.com/VerbalExpressions) to have solved it for me.
That is very good to know about.
I usually just go to regexr.com and trial-and-error the syntax until it matches what I want.
Regex kills me sometimes.
How to find out which process is listening on a certain point on my mac. I'm often switching between projects, and have a server from another project running on a port that I now need for another server.
And it looks like Heroku's CLI doesn't always stop all processes correctly when you stop it using ctrl+c
You could add a function to your .bashrc to make this easier:
Then (after restarting your terminal or typing
source ~/.bashrc) typelistening 8080to find out what process is blocking that port.How to properly write a Rails migration file.
Add a column? Huh? What???
Oh yeah. I always copy and paste from old files.
IIRC:
Objective-C block syntax
bash test format and flags
vim macro create and execute
I noticed I could never remember these, so I always make aliases, shell functions, or short ~/bin/ scripts for them instead:
tar: xkcd.com/1168/
netstat flags (other than "-tulpn" which I have memorized as "tull-pin" like "Tolkien")
ssh tunnel syntax
Edit: *in one-line.
Array to list:
List to array:
Clear as mud...
Helpful protip. I learned yesterday, that
list.toArray(new String[0])is faster than the version with the explicit size given.I was about to write the same thing. How to vertically align elements... without using flex π
RAILS MIGRATION
Regex. While I understand how it works and how it can be used, it's difficult for me to memorize the right regex that should be used at every point. So I just google whenever I want to make use of it. :)
Oh yeah that's a big one
I was just like that... but then I've found regex101.com/ and now, I'm almost proficiente writing regex!
regex101 is the single best resource I've ever found for regex.
It's funny in my case. I know enough regex to get by, but I generally need to google to find out how to actually apply it.
Do I need
RegExp.prototype.testorString.prototype.matchin JS? What are the order of parameters inpreg_matchin PHP? What are the little parentheses things called in .NET, captures or groups?I had the same problem, until I found Rubular:
rubular.com/
Bonus tip: making a permalink will also save all the test cases used. Makes for an excellent inline comment!
Same here...
BTW, I knew someone must've been written about regular expressions when I read the title.. π
Me too!
Hahaaahaa
I always have to Google regex. Or copied old code.
Same here. I can only remember $,,*,+ and /s /w. I always end up up googling an example and going from there.
I can never remember how it works either. I found this to be helpful, though! regexr.com/
For me it's "manually start postgresql"
Every once in a while my postgres server isn't running and I know to punch that into my browser and land on this Stack Overflow question, where I proceed to copy this command into my terminal:
It happens infrequently enough that I never bother to alias it or remember how to type it out. I just remember what to Google.
I have postgres installed via homebrew. So I use
brew info postgresto copy the start command :)So did I then I realize how many precious minutes of my life I'm losing so I decided to buy a domain for 75 cents mycodesnippets.space :) I write things down little by little as soon as I need it the first time or I risk to never do it by lazyness !
I was gonna say this. Have bookmarked the stackoverflow post on this. :D
I could never remember "rails new myapp --database=postgresql" :|
cant you just sudo service postgresql start ? :P
On Linux, yes. On OSX, no unfortunately.
Oh yes, I even googled and used this today because my service keeps stopping.
sedandawkand how to use them.I just
ssh-kβ in zsh and just list all previous key generation commands or if I am not sure what I am looking for I use fzfI was helping someone with this earlier this year. Ended up creating a helper for it:
gist.github.com/Kunde21/3633e1e9ef...
Suprised tldr didn't got mentioned.
It's a pretty neat tool to do this kind of things...
Best link I've seen all week. Heroic!!!!!
That's awesome! thanks
Javascript array methods. Is this one in-place, or returning a new array? I don't know, but MDN does!
And centering things. Completely clueless every time.
here's a handy multiple choice questionnaire!
howtocenterincss.com/
holy crap, whoever made this site needs a medal. Great recommendation!!!
How to extract
tar.gzfile in Linux command line!Saw a comment from above and it changed my life.
tar -xzf filenamexzf = "Xtract Ze Files!" (german accent)Excellent, notΓ© that you may get ride of the dash.
tar -xf filenameRead as
tar eXtract File filename.Saw this on an SO answer and never had to google it ever again :)
Wow, I never thought of it.
Thanks :)
I've got your back fam...
github.com/MichaelTd/libBash/blob/...
Everything git related
Yeah. For some reason I really find some git procedures harder to memorise than others. It's ludicrous the number of times I've googled "git unadd a file" and "git reset branch to remote"
How to delete a remote branch in git.
Oh boy, this gets me every. Single. Time.
Cherry picking commits in git, because I can never remember if it's cherrypick or cherry-pick
A more efficient way would be to just do it and correct if it errors, or alias it to git cherry or something
Also, how to exit vim, and how to insert in vim, and basically how on Earth did I end up in vim omg get me out
I've been using Vim now for about 24 years. Primarily because I don't know how to quit.
How to "unignore" files with git... Here is a nice and short way.
I would be responsible for 95% of hits coming from google search into the Tutorialpoint's html5 minimal template. Now I could easily type it in every time I set up a new page, but it is now a matter of extreme laziness I think.
This is stupid but g++ compiling filename and output order in the terminal. I've been doing it for four years now and still failing to remember.
ln -s [source] [destination]orln -s [destination] [source]?find . -name [...] -exec grep '...' {} \;And of course sed, awk and more generally shell syntax (if, loops, switch, etc).
I got a good way to remember argument order for
ln:Destination is optional so it must go second.
By default
lncreates a link with the name of the source in the current directory.Oh yeah, linking. Forgot about that one (obviously, since I need to Google it every time lol).
How to exit vim.
Many moons ago, at one of my first jobs, I got myself in trouble with this. I was editing something in prod without knowing how to save or exit. I was a windows nt guy mostly. So, like one does, I hard-rebooted the server instead of asking for help... After the dust cleared, my boss made me sit at a keyboard for over an hour launching vim and learning how to at least save and exit. :) I have :wq, :q,:q! burned into my muscle memory to this day...
Oh god why did they have the new guy making changes in prod you poor soul
How to spell maintenance.
That's unneccessarrelly, but true.
I don't have to Google the spelling, but I'd say 99% of the time I type "valud". I say it correctly as "val-id" and only mistype because of the QWERTY keyboard layout. This is the only word that I consistently type incorrectly. It's not a speed thing (like "teh"), because it happens when typing slowly as well. I've been typing for a really long time and I'm beginning to think my brain just thinks this is a funny prank.
This! Plus a few other words: convenient, conscience, accommodate. I'm not a native speaker ;).
As a non native english speaker:
vs
Usually, anything that is outside of my basic Git workflow.
Find a file in Linux. I know it involves "find" and "name" but I have to look up the exact syntax each time. (For reference, the sledgehammer version is
find . -name testfile.txtfrom the root of the drive.)PHP array_push and array_key_exists parameters order.
Argument orders in all array functions in PHP for me. That's just horrible. VSCode gives hints though, so that helps. I still have to look up the exact names of functions regularly, though.
this alone should tell you you need to use another language ;)
How to type this:
Β―\_(γ)_/Β―The best thing they ever added to Slack was the /shrug command.
Ha! Me too. I know to go straight to textfac.es
unzip a tar file especially with that different extensions .xz , .bz etc..
vim commands to cut,copy and paste
regex in python and other python builtins . Can't memorize the whole docs right ?
vim...
text-overflow: ellipsis
Updating the list of git remote branches. It doesn't refresh when you sync so it will continue to list remote branches that don't even exist anymore until you manually run the command below. (Which I had to google again to put in this comment.)
git remote update origin --pruneGit, brew, and bundler all have some kind of
pruneflag so it's starting to stick for me.easy to remember because it is like dried fruit!
Setting firewall rules with
iptables.Ever heard of ufw?
webpackconfiguration file.How to flush DNS cache on OSX
I literally added an alias to my ZSH config for this one
alias flushdns='sudo killall -HUP mDNSResponder'
flexbox and grid with all their different attributes and values :/
"How to do x in CSS" where x is anything
My first choice was "Regex", but it seems you guys beat me to that choice.
So, without a shame I can say that everytime I search "how to insert an element at the end of another with jquery". Frigging append(), man.
What gets me is when I'm switching between languages. Java uses
add, Python hasappend, and Ruby usespush. But then some gem will useadd.This is why I shamelessly use IDEs while everyone I work with uses vim.
How to git checkout a remote branch. Iβm gonna try it it without googling
git remote add repoFork <url>git fetch repoForkgit checkout βtrack repoFork/branchI hope thatβs right I just looked it up again yesterday
MySQL and PHP date formatting. Every time. Whatβs weekday again?
When I accidentally commit on master instead of a branch and I need to reset my master to match origin:
git reset --hard origin/masterSQL syntax #ashamed.
How to use "find ... -exec ..." correctly.
Its vs It's
How to use
grepandfind.Also when I write
data = {}in Python, is this asetor adict?This can't be a Set
It's always a dictionary!
If you want an empty Set use:
P.S. it's handy to use the official Python REPL and type
type(youvariable);)The argument order to the various PHP array functions
The order of arguments for map/reduce/filter is JS. Was it (index, item) or (acc, index, item) or (item, index)....
The arguments for JavaScript's array.slice method. Every. Damn. Time.
Vim commands.
Just...I can't even.
ever play:
vim-adventures.com/
?
bonus tip: a lot of unix commands support vim keys by default. i.e. less and man