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:
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
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 !
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?
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.
Developer π Business Analyst π Solution Architect
Still a developer at β€ and spend a lot of my time building personal and client projects from home.
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"
He/Him/His
I'm a Software Engineer and a teacher.
There's no feeling quite like the one you get when you watch someone's eyes light up learning something they didn't know.
Career change decided program love and hate it. Can be frustrating. Learning python the hard way by Zed Shaw. Wonder if I'll ever get a job or be good enough for one. Yeah of course I am :)
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
Oldest comments (242)
sed
andawk
and how to use them.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 :)Oh yes, I even googled and used this today because my service keeps stopping.
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
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 !
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
Me too!
Hahaaahaa
I can never remember how it works either. I found this to be helpful, though! regexr.com/
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.
Same here...
BTW, I knew someone must've been written about regular expressions when I read the title.. π
Same here. I can only remember $,,*,+ and /s /w. I always end up up googling an example and going from there.
I always have to Google regex. Or copied old code.
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!
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?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.
How to make a tar file...
at least extracting is easy (say it in a german accent) tar -xzf "xtract ze files"
Thank you so much.
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
and -czf == 'compress ze files'
well what works for me is tar -xzvf "xtract ze vucking files"
No kidding that's how remember it
Isn't that for zipped tar files? -xzf = extract zipped (tar) file.
Even though as a German with decent English pronunciation this is a little bit insulting, I'll probably never forget this ever again. Thanks! π
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!
How to extract
tar.gz
file in Linux command line!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 :)
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.
How to "unignore" files with git... Here is a nice and short way.
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.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 properly write a Rails migration file.
Add a column? Huh? What???
Oh yeah. I always copy and paste from old files.
IIRC:
Great question, just need to firefox it. Definitely, will reflect on the question.
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.
Regex kills me sometimes.
I usually just go to regexr.com and trial-and-error the syntax until it matches what I want.
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 8080
to find out what process is blocking that port.Some comments may only be visible to logged-in visitors. Sign in to view all comments.