snipt

Ctrl+h for KB shortcuts

Markdown

Change an OS X item's icon.

  1. Get a PNG of some sort.
  2. Open the PNG in Preview.app.
  3. Cmd+A, then Cmd+C
  4. Right click on desired item -> Get Info
  5. Click on the icon in the upper left.
  6. Cmd+V
  7. Profit.
https://snipt.net/embed/7b4fe2fb34ef0267fdab52ec927a0b37/
/raw/7b4fe2fb34ef0267fdab52ec927a0b37/
7b4fe2fb34ef0267fdab52ec927a0b37
markdown
Markdown
7
2019-08-25T02:19:39
True
False
False
Dec 05, 2012 at 05:33 PM
/api/public/snipt/51295/
change-an-os-x-items-icon
<ol> <li>Get a PNG of some sort.</li> <li>Open the PNG in Preview.app.</li> <li>Cmd+A, then Cmd+C</li> <li>Right click on desired item -> Get Info</li> <li>Click on the icon in the upper left.</li> <li>Cmd+V</li> <li>Profit.</li> </ol>
osx

Text only

fix for lion fonts

defaults -currentHost write -globalDomain AppleFontSmoothing -int 0
https://snipt.net/embed/a4cc7f838e4aa583de2b558c0f18d810/
/raw/a4cc7f838e4aa583de2b558c0f18d810/
a4cc7f838e4aa583de2b558c0f18d810
text
Text only
1
2019-08-20T02:56:45
True
False
False
/api/public/snipt/32444/
fix-for-lion-fonts
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>defaults -currentHost write -globalDomain AppleFontSmoothing -int 0 </span></pre></div> </td></tr></table>
fonts, lion, osx

Bash

force kill terminal connection

return + ~ + .
https://snipt.net/embed/bf5db1b334ccfa658787d794b7cdd454/
/raw/bf5db1b334ccfa658787d794b7cdd454/
bf5db1b334ccfa658787d794b7cdd454
bash
Bash
1
2019-08-25T02:19:58
True
False
False
/api/public/snipt/24368/
force-kill-terminal-connection
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">return</span> + ~ + . </span></pre></div> </td></tr></table>
osx

Bash

unix / linux directory tree

ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/   /' -e 's/-/|/' 
https://snipt.net/embed/1e6cc974ab23c7be46253a69cb87b908/
/raw/1e6cc974ab23c7be46253a69cb87b908/
1e6cc974ab23c7be46253a69cb87b908
bash
Bash
1
2019-08-25T01:38:19
True
False
False
/api/public/snipt/3319/
unix-linux-directory-tree
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>ls -R <span class="p">|</span> grep <span class="s2">&quot;:</span>$<span class="s2">&quot;</span> <span class="p">|</span> sed -e <span class="s1">&#39;s/:$//&#39;</span> -e <span class="s1">&#39;s/[^-][^\/]*\//--/g&#39;</span> -e <span class="s1">&#39;s/^/ /&#39;</span> -e <span class="s1">&#39;s/-/|/&#39;</span> </span></pre></div> </td></tr></table>
bash, mac, osx, unix

Bash

flush dns cache on mac os x

dscacheutil -flushcache
https://snipt.net/embed/897f9fed597be095e04359b2c24fd166/
/raw/897f9fed597be095e04359b2c24fd166/
897f9fed597be095e04359b2c24fd166
bash
Bash
1
2019-08-25T01:38:48
True
False
False
/api/public/snipt/2639/
flush-dns-cache-on-mac-os-x
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>dscacheutil -flushcache </span></pre></div> </td></tr></table>
bash, mac, osx

Bash

create a directory from within the command prompt on unix or mac os x

mkdir django-projects
https://snipt.net/embed/3408dabaac8ebd89ca0064301601443b/
/raw/3408dabaac8ebd89ca0064301601443b/
3408dabaac8ebd89ca0064301601443b
bash
Bash
1
2019-08-25T02:15:40
True
False
False
/api/public/snipt/2307/
create-a-directory-from-within-the-command-prompt-on-unix-or-mac-os-x
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>mkdir django-projects </span></pre></div> </td></tr></table>
bash, mac, osx, unix