Also hosted on gitbooks: https://openai.gitbook.io/code-cheatsheets/
Ask HN: Can I see your cheatsheet?
141–150 of 173 posts
Re: Ask HN: Can I see your cheatsheet?
#142I 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/
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?
#143On 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 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?
#144Set 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...
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?
#145It’s like a group-maintained collection of cheatsheets. The git sync is buggy but I’ve made it work.
Re: Ask HN: Can I see your cheatsheet?
#146I 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…
Just curious to hear from someone who's been around the block with this.
Re: Ask HN: Can I see your cheatsheet?
#147I 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...
I know that POD (Plain Old Documentation from Perl) and asciidoc are supported, likely many more.
Re: Ask HN: Can I see your cheatsheet?
#148Earlier 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
Re: Ask HN: Can I see your cheatsheet?
#149The 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?
#150Earlier 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.