Live data from Hacker News

Ask HN: Can I see your cheatsheet?

news.ycombinator.com

141–150 of 173 posts

Re: Ask HN: Can I see your cheatsheet?

#142

I have a massive Cheatsheet for most languages and many packages- https://github.com/jsfuentes/Code-Cheatsheet Also hosted on gitbooks: https://openai.gitbook.io/code-cheatsheets/

Very nice. Found your first Mac shortcut immediately helpful.

I'm assuming you commit an Obsidian vault directly. Do you sweep for secrets before you commit? Your layout resembles my own, but I often dump keys / secrets into my vault "temporarily" and forget about removing them later.

Re: Ask HN: Can I see your cheatsheet?

#143

On a related note: has anyone used a good tool for using/inserting these kinds of custom snippets? It would be neat to have a snippet manager with quick search bound to a keypress.

I made my own with search and autocomplete, it works for me and I have it on GitHub, but it's pretty specific to my workflow and there are so many different options in this thread (a lot of which are probably better).

I also liked the idea here to prefix all your scripts https://news.ycombinator.com/item?id=31846902 and would personally recommend using fish or zsh with the improvements from ohmyzsh for autocomplete and hints.

Re: Ask HN: Can I see your cheatsheet?

#144

Set a huuuuuuuge shell history https://github.com/craigjperry2/dotfiles/blob/aa77ddcbde63bf... then fzf ctrl+r bindings mean you can recall anything right where you need it. If you’re going to do this then have an escape hatch for commands you don’t want memorised https://github.com/craigjperry2/dotfiles/blob/aa77ddcbde63bf...

a good idea, some notes:

1. 10,000 isn't 'huuuuge' for long lived workstations, but 100k ought to be good for a while (bash, but not zsh, allows disabling truncation entirely with SAVEHIST=-1)

2. if using bash, make sure that this init stuff is sourced by both login and non-login shells (from ~/.bash_profile vs ~/.bashrc respectively)

3. specifying a non-default HISTFILE near your SAVEHIST (as shown in that zshrc link) can go a long way toward avoiding an improperly-configured shell truncating your huge history log, eg point 2

Re: Ask HN: Can I see your cheatsheet?

#146
post #60

I use my ebooks for reference: * GNU grep and ripgrep ( https://learnbyexample.github.io/learn_gnugrep_ripgrep/ ) * GNU sed ( https://learnbyexample.github.io/learn_gnused/ ) * GNU awk ( https://learnbyexample.github.io/learn_gnuawk/ ) * Ruby one-liners cookbook ( https://learnbyexample.github.io/learn_ruby_oneliners/ ) * Perl one-liners cookbook ( https://learnbyexample.github.io/learn_perl_oneliners/ ) * Command li…

I see you sell your books as ebooks (awesome BTW), but there's no print option. I've been looking into publishing methods for a book I've been writing, and having a print copy is very appealing (I'm a big physical book fan, personally). I see a lot of modern software books are digital only. Is this due to the margins on print being much lower than digital? Print on demand is a really neat concept to me, but seems to come at a cost.

Just curious to hear from someone who's been around the block with this.

Re: Ask HN: Can I see your cheatsheet?

#147
post #85

I write down all my commands, ever issued in the terminal, in temporal ordered markdown files per task/project. This means I can go back, compare, see how I did it in the past and improve, if possible. Or investigate, why something isn't working (based on my noted commands, which is eaier in hindsight).

How do you format them? Mine look very verbose, I don't like markdown at all, but since Gitlab/Github renders them, you can't use anything else...

Github renders lots of text formats (though not in issues, pull requests), but it's surprisingly hard to find a complete list.

I know that POD (Plain Old Documentation from Perl) and asciidoc are supported, likely many more.

Re: Ask HN: Can I see your cheatsheet?

#148
post #71
post #62

Earlier quoted context omitted.

Most streaming sites break a video into many small fragments, which are listed in a m4mu file. I have a script to download the fragments one by one using curl. To merge the video fragments back into one file, I do the following. Merge video files with ffmpeg - Make a file listing all the videos in sequence. E.g. file 'video01.ts' file 'video02.ts' file 'video03.ts' ... - Generate the file list for files in the curren…

For anyone needing this youtube-dl (and ffmpeg if you need post-dl conversion) can do this for you if it's any easier, point it at the index file and let it do its thing

Youtube-dl is great. I just wanted to build it from scratch, and it was very simple once the underlying streaming tech was understood.

Re: Ask HN: Can I see your cheatsheet?

#149
All my CLI: https://kevin.deldycke.com/2006/12/all-my-command-lines/

The one I'm probably the most proud of is that one-liner to produce GIFs:

  $ ffmpeg -i ./source.mp4 -ss 00:24:52.4 -to 00:24:57.0 -filter_complex "[0:v] fps=12,scale=width=480:height=-1:flags=lanczos,subtitles=source.mp4:si=0:force_style='FontName=Arial Black,Bold=-1,FontSize=26',split [a][b];[a] palettegen=64 [p];[b][p] paletteuse" ./meme.gif
Source: https://kevin.deldycke.com/2006/11/video-commands/

Re: Ask HN: Can I see your cheatsheet?

#150
post #78
post #75

Earlier quoted context omitted.

I‘ve been doing this ever since I migrated from Windows to Mac in 2015. My bash history has over 40k lines, datestamped. I can recall any command I have typed in my terminal in the past seven years. Extremely helpful whenever I need to repeat anything in the terminal. # Edit I sometimes add comments to commands via `# This‘ll do this and that` so that I can find the command by those keywords in the bash history.

This. I've been doing this for a couple of years now, I'm really used to it. I've been "traveling" with my history that is over 70k lines. My dot alias file has only 3 aliases (c=clear, q=exit, gti=git). Hope there's a project out there that helps parse, rank, or do something with a file like this. There must be interesting information.

Is gti=git for capturing typos or some other reason?
Post reply on HN