Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

JavaScript

hashbang stylesheet change

1
2
3
4
5
// Swaps out the screen stylesheet for a print stylesheet
if (window.location.hash == '#print=true') {
	var printcssuri = $('link[media=print]:first').attr('href');
	$('link[media=screen]:first').attr('href', printcssuri);
}
https://snipt.net/embed/8316e7f10fd7cefa41accd90fe1f4036/
https://snipt.net/raw/8316e7f10fd7cefa41accd90fe1f4036/
8316e7f10fd7cefa41accd90fe1f4036
js
JavaScript
5
2016-12-10T05:40:54
True
False
False
Mar 18, 2014 at 03:12 AM
/api/public/snipt/122666/
hashbang-stylesheet-change
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1">// Swaps out the screen stylesheet for a print stylesheet</span> </span><span id="L-2"><a name="L-2"></a><span class="k">if</span> <span class="p">(</span><span class="nb">window</span><span class="p">.</span><span class="nx">location</span><span class="p">.</span><span class="nx">hash</span> <span class="o">==</span> <span class="s1">&#39;#print=true&#39;</span><span class="p">)</span> <span class="p">{</span> </span><span id="L-3"><a name="L-3"></a> <span class="kd">var</span> <span class="nx">printcssuri</span> <span class="o">=</span> <span class="nx">$</span><span class="p">(</span><span class="s1">&#39;link[media=print]:first&#39;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s1">&#39;href&#39;</span><span class="p">);</span> </span><span id="L-4"><a name="L-4"></a> <span class="nx">$</span><span class="p">(</span><span class="s1">&#39;link[media=screen]:first&#39;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s1">&#39;href&#39;</span><span class="p">,</span> <span class="nx">printcssuri</span><span class="p">);</span> </span><span id="L-5"><a name="L-5"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
CSS, jQuery, link, meta, theme

PHP

WordPress - Convert text URL into a link

1
2
3
4
5
6
function make_text_links() 
{
	$string = get_the_content();
	return make_clickable($string);
}
add_filter( 'the_content', 'make_text_links' );
https://snipt.net/embed/b0f50c02c96045fe1b6db318eb227519/
https://snipt.net/raw/b0f50c02c96045fe1b6db318eb227519/
b0f50c02c96045fe1b6db318eb227519
php
PHP
6
2016-12-10T10:51:00
True
False
False
Jan 05, 2014 at 11:34 PM
/api/public/snipt/103981/
wordpress-convert-text-url-into-a-link
<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="x">function make_text_links() </span> </span><span id="L-2"><a name="L-2"></a><span class="x">{</span> </span><span id="L-3"><a name="L-3"></a><span class="x"> $string = get_the_content();</span> </span><span id="L-4"><a name="L-4"></a><span class="x"> return make_clickable($string);</span> </span><span id="L-5"><a name="L-5"></a><span class="x">}</span> </span><span id="L-6"><a name="L-6"></a><span class="x">add_filter( &#39;the_content&#39;, &#39;make_text_links&#39; );</span> </span></pre></div> </td></tr></table>
URL, WordPress, link

HTML

Direct link to a file in Google Drive

http://googledrive.com/host/<folderID>/<filename>
https://snipt.net/embed/56115e84b86f29148d6a1212fc1be58d/
https://snipt.net/raw/56115e84b86f29148d6a1212fc1be58d/
56115e84b86f29148d6a1212fc1be58d
html
HTML
1
2016-12-10T08:54:36
True
False
False
Jul 05, 2013 at 02:36 PM
/api/public/snipt/66465/
direct-link-to-a-file-in-google-drive
<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>http://googledrive.com/host/<span class="p">&lt;</span><span class="nt">folderID</span><span class="p">&gt;</span>/<span class="p">&lt;</span><span class="nt">filename</span><span class="p">&gt;</span> </span></pre></div> </td></tr></table>
"Google Drive", HTML, link

HTML

Ultima versión de Jquery

<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
https://snipt.net/embed/9de7fd80ad1911ad22c93c3e4b9a9d94/
https://snipt.net/raw/9de7fd80ad1911ad22c93c3e4b9a9d94/
9de7fd80ad1911ad22c93c3e4b9a9d94
html
HTML
1
2016-12-10T08:54:53
True
False
False
Jun 26, 2013 at 11:33 AM
/api/public/snipt/65748/
ultima-version-de-jquery
<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="p">&lt;</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">&quot;http://code.jquery.com/jquery-latest.min.js&quot;</span> <span class="na">type</span><span class="o">=</span><span class="s">&quot;text/javascript&quot;</span><span class="p">&gt;&lt;/</span><span class="nt">script</span><span class="p">&gt;</span> </span></pre></div> </td></tr></table>
jquery, link

CSS

external link style

1
2
3
4
a[rel='external']{
	background: url(images/link_out.png) no-repeat right;
	padding-right: 11px;
}
https://snipt.net/embed/d22b3474da1b07890deb3858b898bcac/
https://snipt.net/raw/d22b3474da1b07890deb3858b898bcac/
d22b3474da1b07890deb3858b898bcac
css
CSS
4
2016-12-10T08:55:31
True
False
False
/api/public/snipt/52409/
external-link-style
<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">a</span><span class="o">[</span><span class="nt">rel</span><span class="o">=</span><span class="s1">&#39;external&#39;</span><span class="o">]</span><span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="nb">background</span><span class="o">:</span> <span class="sx">url(images/link_out.png)</span> <span class="nb">no-repeat</span> <span class="nb">right</span><span class="p">;</span> </span><span id="L-3"><a name="L-3"></a> <span class="nb">padding-right</span><span class="o">:</span> <span class="m">11px</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>
css, link

CSS

lightbox link style

1
2
3
4
a[rel^='lightbox']{
	background: url(images/link_image.png) no-repeat right;
	padding-right: 10px;
}
https://snipt.net/embed/0d349df412339ff79bb25537734d3d15/
https://snipt.net/raw/0d349df412339ff79bb25537734d3d15/
0d349df412339ff79bb25537734d3d15
css
CSS
5
2016-12-10T08:55:42
True
False
False
Dec 27, 2012 at 07:05 AM
/api/public/snipt/52408/
lightbox-link-style
<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">a</span><span class="o">[</span><span class="nt">rel</span><span class="o">^=</span><span class="s1">&#39;lightbox&#39;</span><span class="o">]</span><span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="nb">background</span><span class="o">:</span> <span class="sx">url(images/link_image.png)</span> <span class="nb">no-repeat</span> <span class="nb">right</span><span class="p">;</span> </span><span id="L-3"><a name="L-3"></a> <span class="nb">padding-right</span><span class="o">:</span> <span class="m">10px</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>
css, lightbox, link
Copyrighted, illegal, or inappropriate content? Email [email protected].