Comments (6)
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.
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.
@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:
- cheat.sheets (internal repository of cheat.sh: https://github.com/chubin/cheat.sheets)
- tldr
- cheat (cheat/cheatsheets)
- the rest
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:
- Basically, you can chose any repository of the both, because both of them are available via cheat.sh.
- If you take
cheat/cheetsheets
, the cheat sheet will be available not for cheat.sh users only, but for thecheat
users too. - 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.
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.
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.
@dufferzafar I moved our discussion to chubin/cheat.sh#147
Let's continue our discussion there
from cheat.sheets.
Related Issues (11)
- Are these different than the live ones? HOT 4
- Cheat sheet standardized formatting HOT 16
- jq cheat sheet HOT 2
- Add fstab cheat sheet HOT 4
- bash strings HOT 3
- 🍃 Add Spring Boot CLI (spring) HOT 2
- Awk issue HOT 2
- [emacs] too much info? HOT 1
- Having colon in filenames makes it impossible to clone the repository on windows HOT 1
- Add i3 cheatsheet HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cheat.sheets.