Code Monkey home page Code Monkey logo

Comments (6)

dufferzafar avatar dufferzafar commented on August 15, 2024 2

There is an edit button the website: http://cht.sh/git that links to the repo that this sheet came from.

Can you please add such a link in the response returned from curl as well?

So it'll be easier to see which repo this file is coming from.

from cheat.sheets.

dufferzafar avatar dufferzafar commented on August 15, 2024

Something that is directly related to this duplication issue:

Quite some time ago, I added a cpdf sheet to the cheatsheets repo: https://github.com/cheat/cheatsheets/blob/master/cpdf

But then, I stopped using that cheat tool and started using cht.sh (simply because it works over curl)

Now, when I query cht.sh cpdf I expect to see the sheet that I added (which has a LOT of content)

But instead, what I see is: https://github.com/tldr-pages/tldr/blob/master/pages/common/cpdf.md

And I don't really want to see that 😞

from cheat.sheets.

chubin avatar chubin commented on August 15, 2024

@dufferzafar Hi Shadab, you are right, it is not good. It the original default behaviour of cheat.sh: it has some order of the upstream repositories, and it takes a cheat from the first (according to this order) repository where it was found.

That is the order:

This should be fixed:

  • all cheat sheets from all upstream repositories must be shown by default
  • there are must be a way do address a cheat sheet from some repository directly (say: cheat:cpdf).

To your question, where you should add a jq cheat sheet:

  1. Basically, you can chose any repository of the both, because both of them are available via cheat.sh.
  2. If you take cheat/cheetsheets, the cheat sheet will be available not for cheat.sh users only, but for the cheat users too.
  3. If you plan to write a quite long cheat sheet, cheat.sheets is probably a better bet, because it encourages writing big cheat sheets that can be queried with special ~keyword subqueries,
    like this:
curl cht.sh/tmux~panes

from cheat.sheets.

dufferzafar avatar dufferzafar commented on August 15, 2024

all cheat sheets from all upstream repositories must be shown by default

Thank you, this will solve my issues!

It may result in some duplicated commands though. We'll see how bothersome it is later.

there are must be a way do address a cheat sheet from some repository directly (say: cheat:cpdf)

agreed! and if so, can it be turned into a config somehow?

I personally would like the repository order to be: cheat/cheatsheets, cheat.sheets, tldr, the rest, but other people may have their own preferences for this.

Maybe something like cht.sh --prefer cheat/cheatsheets or something? Not sure about this.

If you plan to write a quite long cheat sheet, cheat.sheets is probably a better bet

I do plan to write a longer sheet, but I'll probably still stick with the cheat/cheatsheets repo, because I wasn't aware of this ~keyword syntax 😅 and I'll probably forget it as well.

I have this function in my dotfiles:

c() {
    #                   Remove escape sequences
    cht.sh "$1" | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | bat --style=plain -l bash
}

So I run c tmux and to "filter" I by pressing & in the less viewer that opens and type pane.

from cheat.sheets.

chubin avatar chubin commented on August 15, 2024

Just a several notes:

  • You don't need this part: sed "s,\x1B\[[0-9;]*[a-zA-Z],,g", use ?T instead; ANSI will be filtered away at the server side.

  • the ~ subqueries work with all cheat sheets, not only with cheat sheets from cheat.sheets; I just wanted to say that you are encouraged to write big cheats in cheat.sheets (comparing to other repositories where cheat.sheets are supposed to be small or midsized)

  • about the link: yes, agreed; it would be even better to have a special cli option for that, like -e:

cht.sh -e cpdf
  • I want to a new (big) cheat sheet for jq anyway, feel free to edit/extend it.

from cheat.sheets.

chubin avatar chubin commented on August 15, 2024

@dufferzafar I moved our discussion to chubin/cheat.sh#147
Let's continue our discussion there

from cheat.sheets.

Related Issues (11)

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.