chubin / cheat.sh Goto Github PK
View Code? Open in Web Editor NEWthe only cheat sheet you need
Home Page: https://cheat.sh/
License: MIT License
the only cheat sheet you need
Home Page: https://cheat.sh/
License: MIT License
e.g. https://cheat.sh/csharp shows the following:
Does cheat.sh exist as a plug in on atom?
cheat.sh is inaccessible using IPv6.
It seems use command line client will wait more time than curl mode. For example:
cht.sh java :learn
vs
curl cht.sh/java/:learn
cht.sh shell script on MacOS High Sierra (sorry no access older revs) throws message:
$ cht.sh --shell go
DEPENDENCY: please install "xsel" for "copy"
type 'help' for the cht.sh shell help
Suggest support pbcopy in place of xsel for MacOS
If there was a python lib for this, it could be used within the python shell in my ide (PyCharm), or probably any other decent ide, with little or no special plugins needed. Secondarily, a windows command option would be helpful since the bash script nor curl works with windows without something like cywin. (and please no windows bashing, I prefer Linux as well, but you work with what you are given at many jobs).
The command:
curl cheat.sh/go/:learn
returns
Unknown topic
I am curious, how did you make the gif for cheat.sh?
what tool was it
I downloaded it and its only 621kb in size for a gif that seems to be over a minute long
I would love to know
I feel like I must be missing something, but I can't find any mention of it: Is there no way to get data in JSON or another structured format from the site? It would make it much easier to cleanly present individual entries in clients.
cheat.sh/perl/subroutines
and
cheat.sh/Perl/Subroutines
Should return the same thing.
Hello,
I just discovered cheat.sh and it is brilliant !
However the Readme does mention a Emacs mode but no vimscript and indeed I didn't found one, thus I wrote one. It is quite basic, but here it is : https://github.com/dbeniamine/cheat.sh-vim
bests,
David
Same issue here: alexanderepstein/Bash-Snippets#43
Just though it would help to track the issue by adding it here.
flake8 testing of https://github.com/chubin/cheat.sh on Python 3.6.3
$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
./lib/get_answer.py:80:15: F821 undefined name 'remove_initial_underscore'
dirname = remove_initial_underscore(dirname)
^
1 F821 undefined name 'remove_initial_underscore'
1
Hello, is possible to add support for markdown language? For example, when i looking for: vim hash i have answer with:
" 1. First, go to the first line you want to comment, press
" <kbd>Ctrl</kbd><kbd>V</kbd>. This will put the editor in the VISUAL
" BLOCK mode.
Is possible to interpreting this markdown?
So we could query stackoverflow for Qt (C++?) QML questions
?T
exists, but to use it I have to quote the URI, which is annoying.I'm not sure if this is intentional or not, but I thought it worth a mention just in case...
When doing a search, with terminal highlighting on (the default), the output looks something like this:
With terminal highlighting turned off ("?T" added to the URL), the output appears a little mangled in places. The initial [ in the [] that would normally appear to wrap a topic is missing, and subsequent topics appear to be missing end-of-lines before the following text. For example:
I'd suggest that this makes for a slightly less readable output when using unhighlighted output, and potentially harder-to-parse/markup output when using unhighlighted output to feed another process.
Am I missing something?
bash-3.2$ curl cheat.sh/tar
... snip ...
<a href="https://twitter.com/igor_chubin" class="twitter-follow-button" data-show-count="false" data-button="grey">Follow @igor_chubin</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<!-- Place this tag where you want the button to render. -->
<a aria-label="Star chubin/wttr.in on GitHub" data-count-aria-label="# stargazers on GitHub" data-count-api="/repos/chubin/cheat.sh#stargazers_count" data-count-href="/chubin/cheat.sh/stargazers" data-icon="octicon-star" href="https://github.com/chubin/cheat.sh" class="github-button">cheat.sh</a>
<!-- Place this tag where you want the button to render. --><a aria-label="Star chrisallenlane/cheat on GitHub" data-count-aria-label="# stargazers on GitHub" data-count-api="/repos/chrisallenlane/cheat#stargazers_count" data-count-href="/chrisallenlane/cheat/stargazers" data-icon="octicon-star" href="https://github.com/chrisallenlane/cheat" class="github-button">cheat</a>
<!-- Place this tag right after the last button or just before your close body tag. -->
<script async defer id="github-bjs" src="https://buttons.github.io/buttons.js"></script>
</body>
</html>
Replace
mkdir -p ~/.bash.d/cht.sh
by
mkdir -p ~/.bash.d
Absolute path /home/igor/
is hard-coded in some places (files listed below) in the code base. I think it might be better if this was configurable through some mechanism like env vars etc. (Not sure if it's already possible. Did not thoroughly look into the code)
globals.py
get_answer.py
panela/panela_colors.py
adapter_learnxiny.py
By having a text representation inside the meta description tag on the html header we will enable clients like telegram that leverage that info to create link previews to give more info to the users at a glance.
flake8 testing of https://github.com/chubin/cheat.sh on Python 3.6.3
$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
./bin/srv.py:123:13: E999 SyntaxError: invalid syntax
print url
^
./lib/adapter_learnxiny.py:32:18: E999 SyntaxError: invalid syntax
print self.prefix, self._topics_list
^
./lib/beautifier.py:240:23: E999 SyntaxError: invalid syntax
print unindent_code
^
./lib/get_answer.py:276:29: E999 SyntaxError: invalid syntax
print "query_text = ", query_text
^
./lib/globals.py:32:18: E999 SyntaxError: invalid syntax
print text
^
./lib/panela/panela_colors.py:365:44: F821 undefined name 'basestring'
if color and not isinstance(color, basestring):
^
./lib/panela/panela_colors.py:370:54: F821 undefined name 'basestring'
if background and not isinstance(background, basestring):
^
5 E999 SyntaxError: invalid syntax
2 F821 undefined name 'basestring'
7
... whereas others work.
Not working: e.g. http://cheat.sh/~php, http://cheat.sh/~go
Working: http://cheat.sh/~phpa (or meaningful searches, such as http://cheat.sh/~sql )
Seems to be a problem with searches whose keyboard directly corresponds to a namespace.
(Anyway, great work, I love this! :) )
I tried
cht.sh python reversed a list style=xcode
cht.sh> python reverse a list style=xcode
They are clearly not xcode. Thanks!
Running python srv.py
gave an import error.
$ python bin/srv.py
Traceback (most recent call last):
File "bin/srv.py", line 9, in
from gevent.wsgi import WSGIServer
ImportError: No module named wsgi
Would you mind adding documentation on how to run your own cheat.sh server. Thanks.
On macOS High Sierra 10.13.1
Cannot use cd
command to change my context for queries. Queries work normally, and I can run /:context QUERY
normally.
$ curl https://cht.sh/:cht.sh > /usr/local/bin/cht.sh
$ chmod +x /usr/local/bin/cht.sh
$ brew install rlwrap
cht.sh --shell
cht.sh> cd go
Invalid section: go
Valid sections:
cht.sh> cd csharp
Invalid section: csharp
Valid sections:
cht.sh> cd arduino
Invalid section: arduino
Valid sections:
cheat.sh/:post makes the following reference to cheat.sh/:wanted
If you want contribute to the project, but you have no idea what
cheat sheet you should post, check the list of the most wanted cheat sheets:
cheat.sh/:wanted
But apparently that page does not exist and instead shows 'Unknown topic'.
I am using cht.sh in vim. I can easily search for queries and it displays in pager but when I try to paste the answer vim throws error. ( I have tried all 3 paste methods (Kp, KP and KC) nothing works
Error detected while processing function cheat#navigate:
line 58:
Zero count: d0
Sending query : "python/lxml+install+error" to https://cht.sh this may take some time
Error detected while processing function cheat#navigate..108_handleRequest:
line 31:
E117: Unknown function: job_start
E15: Invalid expression: job_start(curl, {"callback": "cheat#handleRequestOutput", "close_cb": "cheat#printAnswer"})
Press ENTER or type command to continue
cht.sh returns message about high load if special query is not defined or not understood:
+ $ curl -s cht.sh/python/: | head -3
# Sorry, we are experiencing extremely highload now.
# We are working on the problem and hope to get it fixed soon.
# Please come back in several hours or try some other queries:
+ $ curl -s cht.sh/bash/: | head -3
# Sorry, we are experiencing extremely highload now.
# We are working on the problem and hope to get it fixed soon.
# Please come back in several hours or try some other queries:
+ $ curl -s cht.sh/bash/:foobar | head -3
# Sorry, we are experiencing extremely highload now.
# We are working on the problem and hope to get it fixed soon.
# Please come back in several hours or try some other queries:
Ubuntu 18.04
xsel 1.2.0
First of all I don't know if is a xsel
or cht.sh
client problem.
Shell mode:
$ cht.sh --shell
cht.sh> cd python
cht.sh/python> append file
# python - How do you append to a file?
with open("test.txt", "a") as myfile:
myfile.write("appended text")
cht.sh/python> copy
copy: 4 lines copied to the selection
The output says it was copied.
I try to paste (ctrl + v) it somewhere and I realized it was not on the clipboard.
But if I run the xsel
command it shows the output:
$ xsel
# python - How do you append to a file?
with open("test.txt", "a") as myfile:
myfile.write("appended text")
I can reproduce something like:
$ cat /etc/hosts | xsel --clipboard
And this works with either ctrl + v
or the xsel
command.
Hi, how i may use cheat.sh offline, some of my servers don`t have access to the enternet, but i want to use cheat.sh)
Hello guy and thanks for this awesome tool...
Is this available on sublime text editor as plug in?
If not, how can i contribute ?
Thanks
Observe:
temporal@galactica~> curl cht.sh/lisp
Unknown topic.
Do you mean one of these topics may be?
* lisp/ 100
* elisp/ 89
* alias 67
Changing the URL to cht.sh/alias correctly gives a list of examples, while lisp and elisp are always reported as unknown. My guess is, something somewhere is storing those tokens with forward slash in the name, whereas the HTTP handling code strips it out from request.
Would be nice if the site was available via https as well.
Hello,
I always find myself wanting to add more to many of the sheets, specially the unix commands. In the readme it says one way to do that is find the url and use the browser. I'm using the cli cht.sh, wondering how to find the url of the specific sheet I'm looking at?
Thanks.
curl cht.sh/ruby/lamba
# Sorry, we are experiencing extremely highload now.
# We are working on the problem and hope to get it fixed soon.
# Please come back in several hours or try some other queries:
#
# For example:
curl cht.sh/:list to list available cheat sheets
curl cht.sh/LANGUAGE/:list to list available cheat sheets for LANGUAGE
curl cht.sh/LANGUAGE/:learn to learn the LANGUAGE
i misspelled lambda and it gave me that error. Seems like it should tell me i'm wrong instead
On MacOS curl cht.sh
returns normal HTML page for me instead of a plain text version of the cheatsheet, however curl -q cht.sh
works fine.
Steps to reproduce:
Actual result:
Dropdown design is broken. Screenshot attached.
Reason:
https://cheat.sh/files/fonts/stylesheet.css is missing.
Configuration:
Windows 10, Chrome (latest)
https://github.com/chrisallenlane/cheat
This project has existed for years and has a big following, among others like https://github.com/hubsmoke/bro and https://github.com/tldr-pages/tldr.
Please strongly consider changing the name so as not to conflict with the existing project that had it first.
Path ~/.cht.sh/
is hard-coded as the client configuration location in the client. Would it be possible to make the client configuration location configurable. The XDG Base Directory Specification might also provide a sensible default location.
yay [Search Term]
yay -Ps
yay -Pu
yay -Yc
yay -G
yay -Y --gendb
yay -Syu --devel --timeupdate
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
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.