Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

Bash

Clear contents of file but dont delete it

cat /dev/null > file
https://snipt.net/embed/bb4c74f5bb5471cfee5e14aa071214d5/
https://snipt.net/raw/bb4c74f5bb5471cfee5e14aa071214d5/
bb4c74f5bb5471cfee5e14aa071214d5
bash
Bash
1
2016-12-02T08:31:25
True
False
False
Sep 03, 2013 at 05:12 AM
/api/public/snipt/78646/
clear-contents-of-file-but-dont-delete-it
<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>cat /dev/null &gt; file </span></pre></div> </td></tr></table>
bash, clear, linux, ssh

CSS

clear placeholder

1
2
3
4
input:focus::-webkit-input-placeholder
{
	color: transparent;
}
https://snipt.net/embed/620afb440037610f4b9ee71f999a5913/
https://snipt.net/raw/620afb440037610f4b9ee71f999a5913/
620afb440037610f4b9ee71f999a5913
css
CSS
4
2016-12-02T16:46:32
True
False
False
May 06, 2013 at 12:22 PM
/api/public/snipt/60785/
clear-placeholder
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nt">input</span><span class="nd">:focus</span><span class="o">:</span><span class="nd">:-webkit-input-placeholder</span> </span><span id="L-2"><a name="L-2"></a><span class="p">{</span> </span><span id="L-3"><a name="L-3"></a> <span class="nb">color</span><span class="o">:</span> <span class="nb">transparent</span><span class="p">;</span> </span><span id="L-4"><a name="L-4"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
clear, css, placeholder

C#

Clear a datagridview

dataGridViewID.DataSource = null;
https://snipt.net/embed/2e287937ac400882d78e1a4488d6f277/
https://snipt.net/raw/2e287937ac400882d78e1a4488d6f277/
2e287937ac400882d78e1a4488d6f277
csharp
C#
1
2016-11-30T13:42:30
True
False
False
/api/public/snipt/33491/
clear-a-datagridview
<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="n">dataGridViewID</span><span class="p">.</span><span class="n">DataSource</span> <span class="p">=</span> <span class="k">null</span><span class="p">;</span> </span></pre></div> </td></tr></table>
clear, datagridview

PHP

borrar tags html de un texto

1
2
3
4
<?php
$text = '<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>';
echo strip_tags($text);
?>
https://snipt.net/embed/fb98f47d3affdc583f50a63157f788ca/
https://snipt.net/raw/fb98f47d3affdc583f50a63157f788ca/
fb98f47d3affdc583f50a63157f788ca
php
PHP
4
2016-11-29T22:59:48
True
False
False
/api/public/snipt/13342/
borrar-tags-html-de-un-texto
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a><span class="nv">$text</span> <span class="o">=</span> <span class="s1">&#39;&lt;p&gt;Test paragraph.&lt;/p&gt;&lt;!-- Comment --&gt; &lt;a href=&quot;#fragment&quot;&gt;Other text&lt;/a&gt;&#39;</span><span class="p">;</span> </span><span id="L-3"><a name="L-3"></a><span class="k">echo</span> <span class="nb">strip_tags</span><span class="p">(</span><span class="nv">$text</span><span class="p">);</span> </span><span id="L-4"><a name="L-4"></a><span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
clear, limpiar, php

Bash

Clear out history

1
2
3
4
5
6
history -c 

#w ill clear the entire bash history.

# To only clear the current session history use:
history -r.
https://snipt.net/embed/5412e7c9176602ab87609b8a599205e5/
https://snipt.net/raw/5412e7c9176602ab87609b8a599205e5/
5412e7c9176602ab87609b8a599205e5
bash
Bash
6
2016-12-02T14:16:56
True
False
False
/api/public/snipt/5173/
clear-out-history
<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="nb">history</span> -c </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="c1">#w ill clear the entire bash history.</span> </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a><span class="c1"># To only clear the current session history use:</span> </span><span id="L-6"><a name="L-6"></a><span class="nb">history</span> -r. </span></pre></div> </td></tr></table>
clear, delete, history

Bash

clear DNS cache in leopard

dscacheutil -flushcache
https://snipt.net/embed/e607e240fa54a1d590ac36031f6909cb/
https://snipt.net/raw/e607e240fa54a1d590ac36031f6909cb/
e607e240fa54a1d590ac36031f6909cb
bash
Bash
1
2016-11-25T12:32:41
True
False
False
/api/public/snipt/3811/
clear-dns-cache-in-leopard
<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>
"mac os", cache, clear, dns

Bash

clear memory cache in linux

sync; echo 3 > /proc/sys/vm/drop_caches
https://snipt.net/embed/467ff4ee4dc1647748e2f1b684046777/
https://snipt.net/raw/467ff4ee4dc1647748e2f1b684046777/
467ff4ee4dc1647748e2f1b684046777
bash
Bash
1
2016-12-02T14:12:56
True
False
False
/api/public/snipt/2070/
clear-memory-cache-in-linux
<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>sync<span class="p">;</span> <span class="nb">echo</span> <span class="m">3</span> &gt; /proc/sys/vm/drop_caches </span></pre></div> </td></tr></table>
cache, clear, linux, page
Copyrighted, illegal, or inappropriate content? Email [email protected].