Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

Text only

Format a link based on it linking to a pdf

1
2
3
4
5
6
7
8
/* Add formatting based on link type */
.entry-content a[href$=".pdf"]{
background: url(images/pdf.png) no-repeat center right;
padding:10px 33px 10px 0;
color:#FF0000;
}

/* background image can be whatever you want, just make sure you adjust padding to accomodate it */
https://snipt.net/embed/845d9d176391c13cd438e00dba2d9e18/
https://snipt.net/raw/845d9d176391c13cd438e00dba2d9e18/
845d9d176391c13cd438e00dba2d9e18
text
Text only
8
2016-12-02T08:03:10
True
False
False
May 04, 2014 at 03:27 PM
/api/public/snipt/134724/
format-a-link-based-on-it-linking-to-a-pdf-04e7b6e1
<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> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>/* Add formatting based on link type */ </span><span id="L-2"><a name="L-2"></a>.entry-content a[href$=&quot;.pdf&quot;]{ </span><span id="L-3"><a name="L-3"></a>background: url(images/pdf.png) no-repeat center right; </span><span id="L-4"><a name="L-4"></a>padding:10px 33px 10px 0; </span><span id="L-5"><a name="L-5"></a>color:#FF0000; </span><span id="L-6"><a name="L-6"></a>} </span><span id="L-7"><a name="L-7"></a> </span><span id="L-8"><a name="L-8"></a>/* background image can be whatever you want, just make sure you adjust padding to accomodate it */ </span></pre></div> </td></tr></table>
"auto formatting", classes, css, wordpress

Ruby

Print All Ruby Classes in Array

ObjectSpace.each_object(Class).to_a
https://snipt.net/embed/565295092ad7814fa4cbbc8130a6c156/
https://snipt.net/raw/565295092ad7814fa4cbbc8130a6c156/
565295092ad7814fa4cbbc8130a6c156
rb
Ruby
1
2016-12-03T00:06:30
True
False
False
/api/public/snipt/17405/
print-all-ruby-classes-in-array
<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="no">ObjectSpace</span><span class="o">.</span><span class="n">each_object</span><span class="p">(</span><span class="no">Class</span><span class="p">)</span><span class="o">.</span><span class="n">to_a</span> </span></pre></div> </td></tr></table>
ast, classes, objects, ruby, tree

CSS

The order of link pseudo-classes

1
2
3
4
a:link {color: blue;}
a:visited {color: purple;}
a:hover {color: red;}
a:active {color: yellow;}
https://snipt.net/embed/76f9d53e3d73d720f3814d9d325b27e3/
https://snipt.net/raw/76f9d53e3d73d720f3814d9d325b27e3/
76f9d53e3d73d720f3814d9d325b27e3
css
CSS
4
2016-11-24T16:29:57
True
False
False
/api/public/snipt/2232/
the-order-of-link-pseudo-classes
<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="nd">:link</span> <span class="p">{</span><span class="nb">color</span><span class="o">:</span> <span class="nb">blue</span><span class="p">;}</span> </span><span id="L-2"><a name="L-2"></a><span class="nt">a</span><span class="nd">:visited</span> <span class="p">{</span><span class="nb">color</span><span class="o">:</span> <span class="nb">purple</span><span class="p">;}</span> </span><span id="L-3"><a name="L-3"></a><span class="nt">a</span><span class="nd">:hover</span> <span class="p">{</span><span class="nb">color</span><span class="o">:</span> <span class="nb">red</span><span class="p">;}</span> </span><span id="L-4"><a name="L-4"></a><span class="nt">a</span><span class="nd">:active</span> <span class="p">{</span><span class="nb">color</span><span class="o">:</span> <span class="nb">yellow</span><span class="p">;}</span> </span></pre></div> </td></tr></table>
classes, css, order, pseudo
Copyrighted, illegal, or inappropriate content? Email [email protected].