$ curl -I news.ycombinator.com HTTP/1.1 200 OK Content-Type: text/html; charset=utf-8 Cache-Control: private Connection: close Keep in mind that this will fire a HEAD request to the server which, depending on web server you use in development, may not return the exact header you'd get with GET (IIRC, Jetty used to do this). I like to use something like this in such situation: $ curl -s -D /dev/stderr news.ycombinator…
I rarely find I use curl's -s without its -S, e.g. -sS. It seems curl's design is flawed in its definition of -s; perhaps it's historic and it was too late to change it.
Command line tools every web dev needs to know
61–70 of 71 posts
Re: Command line tools every web dev needs to know
#62Earlier quoted context omitted.
Interesting. Can you explain how the command works? I did look at the commandlinefu API page but didn't get it. I know UNIX and also specifically what "$@" means in UNIX but didn't get the meaning of the two uses of it in the commandlinefu URL you show, nor what the openssl part does.
It seems that the API bizarrely expects: [URL]/matching/ssh/c3No - Search results for the query 'ssh' (note that the final segment is a base64-encoding of the search query) So it's passing the command args through 'openssl base64' to encode them as required by the api. $ echo -n ssh | openssl base64 c3No It's not immediately clear to me why they require both - base64 encoding might be useful to allow non-printable/sp…
Re: Command line tools every web dev needs to know
#63Earlier quoted context omitted.
Also, typing. I am frequently amazed to see professional software developers with years of experience in the field, who only type using their two index fingers. You probably do not need to type 120 WPM to be an amazing programmer, but typing without looking at the keyboard is absolutely essential.
I used to be one of those. Until one day a colleague noticed and made a remark. Then I looked at other colleagues and realized my problem. I used http://www.gnu.org/software/gtypist/ to fix it.
Re: Command line tools every web dev needs to know
#64Re: Command line tools every web dev needs to know
#65Earlier quoted context omitted.
I rarely find I use curl's -s without its -S, e.g. -sS. It seems curl's design is flawed in its definition of -s; perhaps it's historic and it was too late to change it.
The junk goes to stderr, so it won't impact anything but your screen when used from the command line. And sometimes (large transfers) you want that information. I think the default is sane. When you're using curl in a script you use -s, when you're using it interactively you want the diagnostics.
$ curl -s does.not.exist; echo $?
6
$ curl -sS does.not.exist; echo $?
curl: (6) Couldn't resolve host 'does.not.exist'
6
$Re: Command line tools every web dev needs to know
#66Another useful one; Fire up a instant web-server from local folder on http://localhost:8080 : > python -m SimpleHTTPServer
$ sudo python -m smtpd -n -c DebuggingServer localhost:25Re: Command line tools every web dev needs to know
#67Earlier quoted context omitted.
It's perhaps one of the effective filters while hiring. Not just the typing speed, but the general use of command line tools and keyboard shortcuts. Most good developers that I know are masters of the keyboard. They rarely ever touch the mouse.
Do you allow them to install their favorite editor? If someone watched me on Visual Studio without letting me install Viemu first, I'd look like an idiot.
Re: Command line tools every web dev needs to know
#68Re: Command line tools every web dev needs to know
#69Earlier quoted context omitted.
I used to be one of those. Until one day a colleague noticed and made a remark. Then I looked at other colleagues and realized my problem. I used http://www.gnu.org/software/gtypist/ to fix it.
I'm still trying, but it's demanding more discipline from me than I thought I'd need at first. It's hard to get rid of bad habits when they've already become muscle memory.
Admittedly, I was typing pretty fast before I started--I think I went from something like 80 wpm to 110. But it was certainly fun!
As an aside, I've found short mental breaks like that really help when I get stuck on some little issue or bug and am not making any progress. It also keeps me from getting too frustrated!
I'm in college taking some CS classes and the actual material is great, but the framework code they give us for projects is really poorly written Python. I've spent more time grappling with Python and their code than I have with AI or compiler concepts! Taking a break whenever I encountered yet another stupid bug helped me avoid spending hours going in circles.
Re: Command line tools every web dev needs to know
#70Also check out HTTPie: https://github.com/jkbr/httpie/ I much prefer it over curl. $ http GET http://yourmom.ca/