santinic / how2 Goto Github PK
View Code? Open in Web Editor NEWAI for the Command Line
Home Page: https://how2terminal.com
License: MIT License
AI for the Command Line
Home Page: https://how2terminal.com
License: MIT License
Google is a known privacy violator and PRISM-contributor. It would be nice to have this search go through DuckDuckGo or (ideally if possible) searx.
In lib\index.js
if(argv.i) {
how2.main(text, argv.l);
}
else {
how2.magic(text, argv.l);
}
What's the purpose of -i? it's undocumented.
Should it be removed (along with how2.magic) or Added to readme.md and help?
$ how2 python request headers
Cannot fetch answers from Stackoverflow.
TypeError: Cannot read property 'body_markdown' of undefined
Is there a way to use http
instead of https
from google? I tried -k
or --skip-ssl-validation
but still got error:
Cannot connect to Google.
Error: Error on response:Error: unable to get local issuer certificate : undefined
When I disconnect from my company VPN, it's fine.
just a nice thought but I've included links to how2 and another tool in the docs for emacs-sos: https://github.com/omouse/emacs-sos#alternatives-to-sos-mode
not sure if you want to include links to emacs-sos or sx.el or other tools or libraries for using stackoverflow through a command-line or text editor.
Firstly google api has rate limits.
Secondly google search is unavailable in some part of the world.
every time I press space following error shown:
Press SPACE for more choices, any other key to quit.
TypeError: Invalid Version: null
at new SemVer (/home/my-user/.npm-packages/lib/node_modules/how2/node_modules/semver/semver.js:279:11)
at compare (/home/my-user/.npm-packages/lib/node_modules/how2/node_modules/semver/semver.js:566:10)
at Function.gt (/home/my-user/.npm-packages/lib/node_modules/how2/node_modules/semver/semver.js:595:10)
at /home/my-user/.npm-packages/lib/node_modules/how2/lib/updates.js:15:19
at Request._callback (/home/my-user/.npm-packages/lib/node_modules/how2/node_modules/npm-latest/lib/npm-latest.js:53:5)
at Request.self.callback (/home/my-user/.npm-packages/lib/node_modules/how2/node_modules/request/request.js:200:22)
at emitTwo (events.js:87:13)
at Request.emit (events.js:172:7)
at Request.<anonymous> (/home/my-user/.npm-packages/lib/node_modules/how2/node_modules/request/request.js:1067:10)
at emitOne (events.js:82:20)
Error while trying to search for a query:
|(node:21174) DeprecationWarning: process.EventEmitter is deprecated. Use require('events') instead. |Cannot connect to Google. Error: Error on response:Error: socket hang up : undefined
OS: Ubuntu 16.04
Node version: v6.3.1
npm version: 3.10.3
how2 version: 1.1.0
I am unable to copy the code from terminal when I am searching for another question with the SPACE
and found an answer. Not able to select the code and copy it. Any help in there?
Using iTerm, trying to select text with the mouse.
It'd be good to allow voting on questions and answers from this.
In the interest of proper credit, should probably add a link and credit to the XKCD comic used here
Direct link to comic: https://xkcd.com/1168/
XKCD also provides a link for hotlinking/embedding which with attribution would be even better than just linking: http://imgs.xkcd.com/comics/tar.png
XKCD's license requests/requires this: https://xkcd.com/license.html
When I click on the space bar for more choices and select an option, a new "window" opens up. It would be nice to be able to copy the text from what's displayed.
Thanks!
How does how2 resolve search queries? Here is what I searched (just to give it a spin)
Q: $how2 scala read file
A: bash - Command substitution in for loop not working
Q: $how2 android launch activity in new task
A: bash - When I run ./command.sh & the background task is ...
Q: $how2 how to use how2
A: software installation - how to install .git file?
Love the premise of the project, but its answers are completely off.
Hi,
can you use (ideally signed) tags for every release? This makes package maintainers life easier.
Thank you.
I'm getting this:
/usr/bin/env: node: No such file or directory
I installed it as instructed in your readme.
Hey,
This looks great!
Would you be able to add a homebrew distribution for OS X?
http://octavore.com/posts/2016/02/15/distributing-go-apps-os-x
cheers
Google auto"corrects" some searches. Could you implement a workaround?
It would be nice to either read the user's default shell, or read a dotfile in the ~ or ~/.config/how2 directory to to set default language.
I use the fish shell, so will never use the default language of Bash for how2.
Currently I've set an alias in my shell.
Im using Babun v1.2.0, Node v0.12.2 on Windows 10
I used npm to uninstall but failed.
$ npm uninstall how2
npm WARN ENOENT ENOENT: no such file or directory, open '/Users/JonyMac/package.json'
npm WARN EPACKAGEJSON JonyMac No description
npm WARN EPACKAGEJSON JonyMac No repository field.
npm WARN EPACKAGEJSON JonyMac No README data
npm WARN EPACKAGEJSON JonyMac No license field.
So how to remove how2 and its all dependencies?
Thanks.
Is there a way to get the active answer's URL?
To reproduce (with or without quotes):
%: how2 youtube api check if copyright taken down
/home/foo/.node/lib/node_modules/how2/lib/utils.js:45
site: matches[1],
^
TypeError: Cannot read property '1' of null
how2 -l bash zip only jpg
/usr/local/lib/node_modules/how2/node_modules/devnull/transports/transport.js:59
Transport.prototype.__proto__ = EventEmitter.prototype;
^
TypeError: Cannot read property 'prototype' of undefined
at Object.<anonymous> (/usr/local/lib/node_modules/how2/node_modules/devnull/transports/transport.js:59:45)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/local/lib/node_modules/how2/node_modules/devnull/transports/stream.js:8:17)
at Module._compile (module.js:571:32)
Node -v
v7.2.1
https://github.com/santinic/how2/blob/master/lib/updates.js#L9-L17
function later(a, b) {
var as = a.split('.');
var bs = b.split('.');
for(var i=0; i<3; i++) {
if(as[i] > bs[i])
return true;
}
return false;
}
later('1.0.9','1.0.10')
This returns true, as the string '9' is later lexicographically than the string '10'.
This can be resolved using semver as can be seen here.
If this seems right, I could make the changes with a PR.
"Cannot fetch answers from Stackoverflow.
TypeError: process.stdin.setRawMode is not a function."
This message occurs every time I use the command how2.
I'm using windows 10 and using Git Bash command line.
Kind regards,
Hi there,
We noticed that your repo has a high severity vulnerability:
Here is the test report for this repo.
If you’d like to fix this vulnerability, Snyk lets you generate a pull request that recommends the best upgrade path - there’s a link to fix this vulnerability on the test report.
Stay secure :-)
Snyk Community
Consider adding a loader animation, while working in interactive mode, and browsing through questions and answers. Makes a big difference in user experience.
To reproduce :
how2 -l vi indent multiple lines quicly
Use the <kbd>></kbd> command. To indent 5 lines, <kbd>5</kbd><kbd>></kbd><kbd>></kbd>. To mark a block of lines and indent it, <kbd>V</kbd><kbd>j</kbd><kbd>j</kbd><kbd>></kbd> to indent 3 lines (vim only). To indent a curly-braces block, put your cursor on one of the curly braces and use <kbd>></kbd><kbd>%</kbd>.
....
It's really cumbersome to read but I don't know how it should be displayed on the cli.
Can a background color do the trick ?
While issuing a query, the app failed with the following error:
⭐ how2 -l android launch activity in new task
-You are doing too many requests to Google. You need to wait a bit before trying again.`
If the app is using an API key shared across all users, it might be hitting a rate limit earlier than expected?
Does how2 require a min version of node?
I did how2 scp from remote
, and then pressed Space:
$how2 scp from remote
scp - How to copy a file from remote server to local machine?
The syntax for scp is:
If you are on the computer from which you want to send file to a remote computer:
scp /file/to/send username@remote:/where/to/put
Here the remote can be a FQDN or an IP address.
On the other hand if you are on the computer wanting to receive file from a remote computer:
scp username@remote:/file/to/send /where/to/put
scp can also send files between two remote hosts:
scp username@remote_1:/file/to/send username@remote_2:/where/to/put
So the basic syntax is:
scp username@source:/location/to/file username@destination:/where/to/put
You can read man scp (http://linux.die.net/man/1/scp) to get more idea on this.
Press SPACE for more choices, any other key to quit.
SyntaxError: Unexpected token <
at Object.parse (native)
at Request._callback (/Users/danqing/.nvm/v0.10.32/lib/node_modules/how2/node_modules/npm-latest/lib/npm-latest.js:49:23)
at Request.self.callback (/Users/danqing/.nvm/v0.10.32/lib/node_modules/how2/node_modules/request/request.js:199:22)
at Request.emit (events.js:98:17)
at Request.<anonymous> (/Users/danqing/.nvm/v0.10.32/lib/node_modules/how2/node_modules/request/request.js:1036:10)
at Request.emit (events.js:117:20)
at IncomingMessage.<anonymous> (/Users/danqing/.nvm/v0.10.32/lib/node_modules/how2/node_modules/request/request.js:963:12)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:943:16
at process._tickCallback (node.js:419:13)
Words get chopped off midway. Why not wrap at 80 columns or whatever the current width of the terminal?
Hi,
i think license of this software is not DFSG compatible (https://people.debian.org/~bap/dfsg-faq.html + https://www.debian.org/social_contract.html#guidelines). I want to package it for Debian, but because of license I can't.
Can you consider changing license to any of:
https://wiki.debian.org/DFSGLicenses
please?
Thanks.
Scraped from http://stackexchange.com/sites?view=list#traffic
http://stackoverflow.com/
http://serverfault.com/
http://superuser.com/
http://meta.stackexchange.com/
http://webapps.stackexchange.com/
http://gaming.stackexchange.com/
http://webmasters.stackexchange.com/
http://cooking.stackexchange.com/
http://gamedev.stackexchange.com/
http://photo.stackexchange.com/
http://stats.stackexchange.com/
http://math.stackexchange.com/
http://diy.stackexchange.com/
http://gis.stackexchange.com/
http://tex.stackexchange.com/
http://askubuntu.com/
http://money.stackexchange.com/
http://english.stackexchange.com/
http://stackapps.com/
http://ux.stackexchange.com/
http://unix.stackexchange.com/
http://wordpress.stackexchange.com/
http://cstheory.stackexchange.com/
http://apple.stackexchange.com/
http://rpg.stackexchange.com/
http://bicycles.stackexchange.com/
http://programmers.stackexchange.com/
http://electronics.stackexchange.com/
http://android.stackexchange.com/
http://boardgames.stackexchange.com/
http://physics.stackexchange.com/
http://homebrew.stackexchange.com/
http://security.stackexchange.com/
http://writers.stackexchange.com/
http://video.stackexchange.com/
http://graphicdesign.stackexchange.com/
http://dba.stackexchange.com/
http://scifi.stackexchange.com/
http://codereview.stackexchange.com/
http://codegolf.stackexchange.com/
http://quant.stackexchange.com/
http://pm.stackexchange.com/
http://skeptics.stackexchange.com/
http://fitness.stackexchange.com/
http://drupal.stackexchange.com/
http://mechanics.stackexchange.com/
http://parenting.stackexchange.com/
http://sharepoint.stackexchange.com/
http://music.stackexchange.com/
http://sqa.stackexchange.com/
http://judaism.stackexchange.com/
http://german.stackexchange.com/
http://japanese.stackexchange.com/
http://philosophy.stackexchange.com/
http://gardening.stackexchange.com/
http://travel.stackexchange.com/
http://productivity.stackexchange.com/
http://crypto.stackexchange.com/
http://dsp.stackexchange.com/
http://french.stackexchange.com/
http://christianity.stackexchange.com/
http://bitcoin.stackexchange.com/
http://linguistics.stackexchange.com/
http://hermeneutics.stackexchange.com/
http://history.stackexchange.com/
http://bricks.stackexchange.com/
http://spanish.stackexchange.com/
http://scicomp.stackexchange.com/
http://movies.stackexchange.com/
http://chinese.stackexchange.com/
http://biology.stackexchange.com/
http://poker.stackexchange.com/
http://mathematica.stackexchange.com/
http://cogsci.stackexchange.com/
http://outdoors.stackexchange.com/
http://martialarts.stackexchange.com/
http://sports.stackexchange.com/
http://academia.stackexchange.com/
http://cs.stackexchange.com/
http://workplace.stackexchange.com/
http://windowsphone.stackexchange.com/
http://chemistry.stackexchange.com/
http://chess.stackexchange.com/
http://raspberrypi.stackexchange.com/
http://russian.stackexchange.com/
http://islam.stackexchange.com/
http://salesforce.stackexchange.com/
http://patents.stackexchange.com/
http://genealogy.stackexchange.com/
http://robotics.stackexchange.com/
http://expressionengine.stackexchange.com/
http://politics.stackexchange.com/
http://anime.stackexchange.com/
http://magento.stackexchange.com/
http://ell.stackexchange.com/
http://sustainability.stackexchange.com/
http://tridion.stackexchange.com/
http://reverseengineering.stackexchange.com/
http://networkengineering.stackexchange.com/
http://opendata.stackexchange.com/
http://freelancing.stackexchange.com/
http://blender.stackexchange.com/
http://mathoverflow.net/
http://space.stackexchange.com/
http://sound.stackexchange.com/
http://astronomy.stackexchange.com/
http://tor.stackexchange.com/
http://pets.stackexchange.com/
http://ham.stackexchange.com/
http://italian.stackexchange.com/
http://pt.stackoverflow.com/
http://aviation.stackexchange.com/
http://ebooks.stackexchange.com/
http://beer.stackexchange.com/
http://softwarerecs.stackexchange.com/
http://arduino.stackexchange.com/
http://expatriates.stackexchange.com/
http://matheducators.stackexchange.com/
http://earthscience.stackexchange.com/
http://joomla.stackexchange.com/
http://datascience.stackexchange.com/
http://puzzling.stackexchange.com/
http://craftcms.stackexchange.com/
http://buddhism.stackexchange.com/
http://hinduism.stackexchange.com/
http://communitybuilding.stackexchange.com/
http://startups.stackexchange.com/
http://worldbuilding.stackexchange.com/
http://ja.stackoverflow.com/
http://emacs.stackexchange.com/
http://hsm.stackexchange.com/
http://economics.stackexchange.com/
http://lifehacks.stackexchange.com/
http://engineering.stackexchange.com/
http://coffee.stackexchange.com/
http://vi.stackexchange.com/
http://musicfans.stackexchange.com/
http://woodworking.stackexchange.com/
http://civicrm.stackexchange.com/
http://health.stackexchange.com/
http://ru.stackoverflow.com/
http://rus.stackexchange.com/
http://mythology.stackexchange.com/
http://law.stackexchange.com/
http://opensource.stackexchange.com/
http://elementaryos.stackexchange.com/
http://portuguese.stackexchange.com/
http://computergraphics.stackexchange.com/
http://hardwarerecs.stackexchange.com/
http://es.stackoverflow.com/
http://3dprinting.stackexchange.com/
http://ethereum.stackexchange.com/
For nearly any issue of importance, there will be several answers. I would like the option to select my preference for a particular answer and be shown that answer automatically instead of the others for a particular query. This could be accomplished by storing a dictionary of queries with the preference value, or by tagging a priority number to the hash of the answer urls (treating untagged as a lower priority), each time an answer is marked up by me, it would increment the priority by 1 thus increasing the visibility of the answer in future queries.
Is there any possibility to integrate with IDE or other text editors?
Thanks!!!
This is really nifty, but there's no way I would ever use sudo and let npm write to files and directories reserved for a real system-wide package manager. If however, it was available as an apt package, RPM, or ebuild, then adoption is more likely.
Hey, I am trying to install on ubuntu 14.04, I had to use sudo, do to permissions issues mentioned. It installed successfully, however now when I run the the command it gives the error:
/usr/bin/env: node: No such file or directory
any ideas?
By default, answers provided by how2
come from Stack Overflow, which has an attribution policy. It's pretty typical to include a comment with a link to the SO answer when using code, so it would be good to include the answer link in the output.
I hacked together a patch that adds the link to both the initial display and the menu selection. I'd be happy to submit a pull request if that would be desirable.
(Disclosure: I work as a Community Manager for Stack Overflow.)
Found this issue while selecting an answer from the list of more answers.
Press SPACE for more choices, any other key to quit.
TypeError: Cannot read property '1' of null
at Object.parseStackoverflowQuestionId (/usr/local/lib/node_modules/how2/lib/utils.js:45:26)
at /usr/local/lib/node_modules/how2/lib/how2.js:20:32
at ScrollableBox.<anonymous> (/usr/local/lib/node_modules/how2/lib/ui.js:66:9)
at ScrollableBox.EventEmitter._emit (/usr/local/lib/node_modules/how2/node_modules/blessed/lib/events.js:94:20)
at ScrollableBox.EventEmitter.emit (/usr/local/lib/node_modules/how2/node_modules/blessed/lib/events.js:117:12)
at ScrollableBox.List.enterSelected (/usr/local/lib/node_modules/how2/node_modules/blessed/lib/widgets/list.js:586:8)
at ScrollableBox.<anonymous> (/usr/local/lib/node_modules/how2/node_modules/blessed/lib/widgets/list.js:119:14)
at ScrollableBox.EventEmitter._emit (/usr/local/lib/node_modules/how2/node_modules/blessed/lib/events.js:94:20)
at ScrollableBox.EventEmitter.emit (/usr/local/lib/node_modules/how2/node_modules/blessed/lib/events.js:117:12)
at Program.<anonymous> (/usr/local/lib/node_modules/how2/node_modules/blessed/lib/widgets/screen.js:602:15)
Since you use j
/k
for movement, and q
to "go back", I was expecting o
to open the selected item in a list. I later discovered that the l
key does the same, but for some reason my fingers wanted o
to open the list item. Perhaps user configurable hotkeys would be nice? Or at least mention hotkeys in --help or in the readme?
The entire string following the interpreter name is passed as a single argument to the interpreter.
Apparently there is no good solution for this yet.
My favorite workaround looks like this in my .bashrc:
alias how2='/usr/bin/env node --no-deprecation "$(which how2)"'
I have to use a http proxy to connect to Google.
I get an error:
Cannot connect to Google.
Error: Error on response:Error: tunneling socket could not be established, cause=socket hang up : undefined
Any idea please?
Steps to reproduce:
TypeError: Cannot read property 'body_markdown' of undefined
at Object.showAnswer (/usr/local/lib/node_modules/how2/lib/ui.js:177:46)
at /usr/local/lib/node_modules/how2/lib/how2.js:120:20
at ScrollableBox.<anonymous> (/usr/local/lib/node_modules/how2/lib/ui.js:151:9)
at ScrollableBox.EventEmitter._emit (/usr/local/lib/node_modules/how2/node_modules/blessed/lib/events.js:94:20)
at ScrollableBox.EventEmitter.emit (/usr/local/lib/node_modules/how2/node_modules/blessed/lib/events.js:117:12)
at ScrollableBox.List.enterSelected (/usr/local/lib/node_modules/how2/node_modules/blessed/lib/widgets/list.js:586:8)
at ScrollableBox.<anonymous> (/usr/local/lib/node_modules/how2/lib/ui.js:155:21)
at ScrollableBox.EventEmitter._emit (/usr/local/lib/node_modules/how2/node_modules/blessed/lib/events.js:94:20)
at ScrollableBox.EventEmitter.emit (/usr/local/lib/node_modules/how2/node_modules/blessed/lib/events.js:117:12)
at Program.<anonymous> (/usr/local/lib/node_modules/how2/node_modules/blessed/lib/widgets/screen.js:603:15)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.