TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Where do you save code snippets or cli commands

8 点作者 Madawar超过 10 年前
Hi, where do you guys save code snippets and/or cli commands that you have just learned before you memorize them?

12 条评论

pjungwir超过 10 年前
I use the `man` system. When you invoke `man` you can pass an optional leading argument indicating which &quot;section&quot; of man pages you want to see, e.g. `man 1 open` and `man 2 open` give different pages.<p>You can add new sections by setting $MANSECT. So I added a new section named with my initials, pj:<p><pre><code> export MANSECT=1:n:l:8:3:2:3posix:3pm:3perl:5:4:9:6:7:pj </code></pre> You can also change where the `man` command searches for manpage files using $MANPATH:<p><pre><code> export MANPATH=&quot;$MANPATH:$HOME&#x2F;man&quot; </code></pre> Now you can just `mkdir -p ~&#x2F;man&#x2F;manpj` and start adding files with a `.pj` extension, like `postgres.pj` and `bash.pj`. Then it&#x27;s super-fast to bring those up by saying `man pj postgres`.<p>Of course you would substitute all the above with your own initials or whatever.<p>You don&#x27;t even have to write the files with the usual formatting macros. Most of the time a plain text file works okay. But it&#x27;s kind of fun to learn enough of that to get by: probably less than a dozen macros for paragraph breaks, underlining, etc.<p>And then you can put your collection of notes on Github like here:<p><a href="https://github.com/pjungwir/manpj" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pjungwir&#x2F;manpj</a><p>Here is a file with a few man macros:<p><a href="https://github.com/pjungwir/manpj/blob/master/bc.pj" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pjungwir&#x2F;manpj&#x2F;blob&#x2F;master&#x2F;bc.pj</a>
97-109-107超过 10 年前
I&#x27;m using <a href="https://github.com/xolox/vim-notes" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;xolox&#x2F;vim-notes</a> and create files for each topic. Recently I could help my colleague by exporting my mongodb-related notes to markdown and publish it for him.
mrfusion超过 10 年前
I&#x27;ve been using gists. Does that seem like an ok idea? My only complaint is that they don&#x27;t show up in google searches or when someone looks at my profile in github so I don&#x27;t really get to share them by default.<p>I also keep forgetting my password :-(
forgotpasswd3x超过 10 年前
I&#x27;ve created a .org file that I keep with useful commands &#x2F; code that I reference pretty often. I keep it in my Dropbox folder so I can access and update it from any of the computers I work on. Seems to do the job.
1781超过 10 年前
.zsh_history with no limit has served me well for a decade
victorstanciu超过 10 年前
I use a simple personal Wiki that I made: <a href="http://wikitten.vizuina.com" rel="nofollow">http:&#x2F;&#x2F;wikitten.vizuina.com</a>
dserodio超过 10 年前
GitBox[1] which is a pretty web UI for Gists<p>[1] <a href="https://gistboxapp.com" rel="nofollow">https:&#x2F;&#x2F;gistboxapp.com</a>
somlor超过 10 年前
I&#x27;ve been using <a href="https://snipt.net" rel="nofollow">https:&#x2F;&#x2F;snipt.net</a> for the last 6 years.
brandonlipman超过 10 年前
I use evernote, that way I can see contextual notes and past use cases.
rendambathu超过 10 年前
Notational Velocity. Using for past 4 years.
jhildings超过 10 年前
many open notepad documents :D :D
Blackthorn超过 10 年前
Google Keep.
评论 #9017103 未加载