Show HN: how2 – stackoverflow.com from the terminal
github.com
github.com
$ howdoi unzip bz2
readcsvbz2file <- read.csv(bzfile("file.csv.bz2"))
how2 switches API depending on what language you are querying.
$ howdoi inverse grep a file
Simply pops this up: $ grep -L "foo" *
...apparently it scrapes the answer result and print the last occurrence of code-formatted text.Whereas `how2` pretty-prints the entire answer, narrative and code, so I know what the respondent was actually addressing. FWIW, both tools don't address what I want (I was thinking `grep -v`)...but that's not a fault of the tools, but of the ambiguity in how we ask questions. `howdoi` has far more faith in there being "Just One Answer"...where `how2` let's you move very quickly between the relevant choices, giving you the right amount of context to navigate.
Well done OP!
~> howdoi parse json python
{"maps":[{"id":"blabla","iscategorical":"0"}, {"id":"blabla","iscategorical":"0"}],
"masks":{"id":"valore"},
"om_points":"value",
"parameters":{"id":"valore"}
}
Yep can't agree more. howdoi -a inverse grep a file
Even basic syntax highlighting is supported using `-c`. alias howdoi="howdoi -a -c "
The other improvements from how2 being a curses app are helpful though.I found this funny:
> It uses Google and Stackoverflow APIs, because Stackoverflow search on its own doesn't works as well.
It doesn't really make sense why Google would be a better entrance point into StackOverflow's content -- but it is -- as I imagine the Google algorithm uses SO's API itself to incorporate SO's data into pagerank in some way (the tags, the points, etc.)...OTOH, after landing on a particular question via Google, if it isn't the thing I actually need, I find SO's list of related questions to almost always be on point.
I think Google instead indexes SO pages as any html, and does a much better job at figuring out what "unzip .bz2" means.
https://www.google.com/search?q=.
https://www.google.com/search?q=.bz2 and https://www.google.com/search?q=bz2 are different, for instance.
But then I saw the video, the way you can specify a language, and the nice format that results are displayed in, along with the option to see more options - this is actually quite nice!
It would be good to have the option to use it with Server Fault (also from StackExchange network) too.
In the short run, a tool like this may make it easier to get to the point where I am living in the terminal.
$ searchcmd "unzip bz2"
.....
tar xjvf (michaelangela.wordpress.com, superuser.com)
bunzip2 filename.bz2 (cyberciti.biz, linuxquestions.org)
tar xvjf filename.tar.bz2 (superuser.com)
bzip2 -d filename.bz2 (superuser.com)
bzip2 -dk filename.bz2 (superuser.com)A couple suggestions:
Does the `-l lang` flag correspond to stackoverflow tags which aren't necessarily limited to languages?
This should be specified because the right tag can significantly increase the quality of search results.
Also, it would be nice to have a keyboard shortcut that opens a question/answer in the browser. That way I can easily vote.
The keyboard shortcut is not hard to add. You could do it yourself :P
how2 -l windows enable tab completion
and got nothing. "PowerShell" and "batch" bring back results, but I am drawing a blank on what to call the Windows Shell (cmd.exe). Thanks!
http://tex.stackexchange.com/questions/2275/keeping-tables-f...
I'm not supporting this yet, let's see if I can make it work so that it uses also other stackexchange.com domains.
Thanks for the suggestion!