Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

JavaScript

Show-Hide

1
2
3
4
5
6
function show(sel) {
	$(sel).css({'display':'block','visibility':'hidden'});
}
function hide(sel) {
	$(sel).css({'display':'none','visibility':'visible'});
}
https://snipt.net/embed/504fba4c837baa026ca851ed22d9c609/
https://snipt.net/raw/504fba4c837baa026ca851ed22d9c609/
504fba4c837baa026ca851ed22d9c609
js
JavaScript
6
2016-12-04T14:54:37
True
False
False
/api/public/snipt/88722/
show-hide-1
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="kd">function</span> <span class="nx">show</span><span class="p">(</span><span class="nx">sel</span><span class="p">)</span> <span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="nx">$</span><span class="p">(</span><span class="nx">sel</span><span class="p">).</span><span class="nx">css</span><span class="p">({</span><span class="s1">&#39;display&#39;</span><span class="o">:</span><span class="s1">&#39;block&#39;</span><span class="p">,</span><span class="s1">&#39;visibility&#39;</span><span class="o">:</span><span class="s1">&#39;hidden&#39;</span><span class="p">});</span> </span><span id="L-3"><a name="L-3"></a><span class="p">}</span> </span><span id="L-4"><a name="L-4"></a><span class="kd">function</span> <span class="nx">hide</span><span class="p">(</span><span class="nx">sel</span><span class="p">)</span> <span class="p">{</span> </span><span id="L-5"><a name="L-5"></a> <span class="nx">$</span><span class="p">(</span><span class="nx">sel</span><span class="p">).</span><span class="nx">css</span><span class="p">({</span><span class="s1">&#39;display&#39;</span><span class="o">:</span><span class="s1">&#39;none&#39;</span><span class="p">,</span><span class="s1">&#39;visibility&#39;</span><span class="o">:</span><span class="s1">&#39;visible&#39;</span><span class="p">});</span> </span><span id="L-6"><a name="L-6"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
function, hide, show

Bash

Show latest branch activity in Git

for k in `git branch|perl -pe s/^..//`;do echo -e `git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k|head -n 1`\\t$k;done|sort -r
https://snipt.net/embed/b19e52b4fa804023dfd0754e8bfd7f03/
https://snipt.net/raw/b19e52b4fa804023dfd0754e8bfd7f03/
b19e52b4fa804023dfd0754e8bfd7f03
bash
Bash
1
2016-12-04T14:39:26
True
False
False
Oct 26, 2012 at 04:51 AM
/api/public/snipt/49081/
show-latest-branch-activity-in-git
<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">for</span> k in <span class="sb">`</span>git branch<span class="p">|</span>perl -pe s/^..//<span class="sb">`</span><span class="p">;</span><span class="k">do</span> <span class="nb">echo</span> -e <span class="sb">`</span>git show --pretty<span class="o">=</span>format:<span class="s2">&quot;%Cgreen%ci %Cblue%cr%Creset&quot;</span> <span class="nv">$k</span><span class="p">|</span>head -n 1<span class="sb">`</span><span class="se">\\</span>t<span class="nv">$k</span><span class="p">;</span><span class="k">done</span><span class="p">|</span>sort -r </span></pre></div> </td></tr></table>
branch, git, show

Bash

Show me 30 brew home pages at a time.

for i in `brew search | sed -n 30,60p` ;do brew home $i; done
https://snipt.net/embed/ead4475ee1ad79bfc0637d376c8a18e0/
https://snipt.net/raw/ead4475ee1ad79bfc0637d376c8a18e0/
ead4475ee1ad79bfc0637d376c8a18e0
bash
Bash
1
2016-12-04T14:40:27
True
False
False
/api/public/snipt/30550/
show-me-30-brew-home-pages-at-a-time
<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">for</span> i in <span class="sb">`</span>brew search <span class="p">|</span> sed -n 30,60p<span class="sb">`</span> <span class="p">;</span><span class="k">do</span> brew home <span class="nv">$i</span><span class="p">;</span> <span class="k">done</span> </span></pre></div> </td></tr></table>
"browse formulae", brew, homebrew, osx, show

Text only

show only dot files and directories

 ls -alF|awk '$8 ~ /^\./ {print $8}'
https://snipt.net/embed/5597b2571b1e842c218426f1182fa89d/
https://snipt.net/raw/5597b2571b1e842c218426f1182fa89d/
5597b2571b1e842c218426f1182fa89d
text
Text only
1
2016-12-04T14:44:48
True
False
False
/api/public/snipt/10326/
show-only-dot-files-and-directories
<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 -alF|awk &#39;$8 ~ /^\./ {print $8}&#39; </span></pre></div> </td></tr></table>
and, directories, dot, files, only, show

Text only

show java object in clojure

1
2
3
 showing the members of a java object (eg HashMap)

(show java.util.HashMap)
https://snipt.net/embed/499f400249744add5496acc145355acc/
https://snipt.net/raw/499f400249744add5496acc145355acc/
499f400249744add5496acc145355acc
text
Text only
4
2016-12-04T14:49:11
True
False
False
/api/public/snipt/6738/
show-java-object-in-clojure
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a> showing the members of a java object (eg HashMap) </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>(show java.util.HashMap) </span></pre></div> </td></tr></table>
java, show
Copyrighted, illegal, or inappropriate content? Email [email protected].