Lynne is the creator of Key Values, a website that helps engineers find teams that share their values. She lives in San Francisco, is an Iron(wo)man, and loves meeting new peeps!
Location
San Francisco
Education
MIT'10 Brain and Cognitive Sciences, UCSF'12 Neuroscience
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. :)
Software Developer, Coffee Glutton, Quality Lover
▫◽◻⬜◻◽▫
My name is Tiago Marques and I am curious. I try to learn more about everything, and seek solutions to the problems around me.
Location
Aalborg, Denmark
Education
University College of Northern Denmark (UCN) | CS💻</>
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.test or String.prototype.match in JS? What are the order of parameters in preg_match in PHP? What are the little parentheses things called in .NET, captures or groups?
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:
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 am a student who loves to contribute and develop in projects.Currently trying to create something that can give purpose to a huge community of developers. I hav no idea what it would turn out to be
I figured out how to remember it. To create tar, use c option and for extracting replace c with x ==> $tar will remain same for both Lol :) . tar -cvf filename.tar file/dir_path && tar -xvf filename.tar.
Top comments (242)
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 😂
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.test
orString.prototype.match
in JS? What are the order of parameters inpreg_match
in 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.
I can never remember how it works either. I found this to be helpful, though! regexr.com/
Same here. I can only remember $,,*,+ and /s /w. I always end up up googling an example and going from there.
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 postgres
to 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 !
cant you just sudo service postgresql start ? :P
On Linux, yes. On OSX, no unfortunately.
I was gonna say this. Have bookmarked the stackoverflow post on this. :D
Oh yes, I even googled and used this today because my service keeps stopping.
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
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 -vxf
Thank you so much.
Even though as a German with decent English pronunciation this is a little bit insulting, I'll probably never forget this ever again. Thanks! 🙈
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
c
option and for extracting replacec
withx
==>$tar
will remain same for both Lol :) .tar -cvf filename.tar file/dir_path
&&tar -xvf filename.tar
.Hey, I also want to make a tar file for my website name:Lenny face. Let me know if the given suggestions works for you!
sed
andawk
and 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!
How to extract
tar.gz
file in Linux command line!Saw a comment from above and it changed my life.
tar -xzf filename
xzf = "Xtract Ze Files!" (german accent)Excellent, noté that you may get ride of the dash.
tar -xf filename
Read 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 :)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.