Giter Club home page Giter Club logo

cheat.sh's People

Contributors

abitrolly avatar albonycal avatar bglopez avatar bl-ue avatar chubin avatar codelongandprosper90 avatar davep avatar fedebuonco avatar floer32 avatar gpazuch avatar grayed avatar greenchili avatar jan200101 avatar joerho avatar joeyciechanowicz avatar johnnadratowski avatar madsmtm avatar md2perpe avatar mre avatar neuhaus avatar rajesh-s avatar ray-g avatar sea-n avatar seirdy avatar strikingloo avatar szymonprz avatar thezeroalpha avatar tsevans avatar waldyrious avatar wandex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cheat.sh's Issues

yay

Presents package selection menu

yay [Search Term]

Prints system statistics

yay -Ps

Prints update list

yay -Pu

Cleans unneeded dependencies

yay -Yc

Downloads PKGBUILD from ABS or AUR

yay -G

Generates development package DB used for devel updates.

yay -Y --gendb

Normal update but also check for development package updates and uses PKGBUILD modification time and not version to determine update

yay -Syu --devel --timeupdate

INSTALATION

git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

cd section fails in shell mode, returns no valid sections

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.

Steps to repro

  1. Install script locally, setup permissions
$ curl https://cht.sh/:cht.sh > /usr/local/bin/cht.sh
$ chmod +x /usr/local/bin/cht.sh
  1. install rlwrap for shellmode
$ brew install rlwrap
  1. launch shell mode
cht.sh --shell
  1. attempt to cd into any section/context
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:

Please don’t color the text by default…

  • People have their own preference for text color, please don’t force it…
  • I know ?T exists, but to use it I have to quote the URI, which is annoying.
  • The color chosen here could be unfriendly to light theme users.

cht.sh script dependency on xsel not supported in MacOS

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

Interpreting markdown

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?

copy not working

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.

Add documentation to run your own mirror

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.

cheat.sh/:wanted does not exist

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'.

How to change style?

I tried

cht.sh python reversed a list style=xcode
cht.sh> python reverse a list style=xcode

They are clearly not xcode. Thanks!

Python lib for making calls

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).

In Vim 7.4: paste option not working showing function errors.

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

Returns HTML instead of plain-text

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.

Unhighlighted search output differs in format from highlighted search output

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:

screen shot 2017-06-02 at 16 24 46

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:

screen shot 2017-06-02 at 16 25 02

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.

Hardcoded configuration location in client.

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.

Returning HTML not raw text.

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>

Support https

Would be nice if the site was available via https as well.

Support for running on Python 3

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

Include content as meta data text representation

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.

Offline usage

Task

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)

Details

Hardcoded absolute paths in code

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

Some languages reported as unknown even though they're suggested

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.

Invalid section

hi, my english is not good, and i hope you can understand what i want to say:
image
this is my raspberry pi displayed, but i expect it should be this :
image
or
image
it seems something is wrong with 'cd' command in my cht.sh

JSON output from site?

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.

How did you make the gif for cheat.sh?

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

Wrong special query returns message about high load

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:

Vim plugin

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

How to get original url form cht.sh cli?

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.

when mistyping, gives error of highload

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.