snipt

Ctrl+h for KB shortcuts

HTML

example of a list item with an anchor in html

<li><a href="url-of-item" title="title-of-item">title-of-item</a></li>
https://snipt.net/embed/d381a6162d8505483b39541691d638c9/
/raw/d381a6162d8505483b39541691d638c9/
d381a6162d8505483b39541691d638c9
html
HTML
1
2019-08-15T07:06:24
True
False
False
/api/public/snipt/2348/
example-of-a-list-item-with-an-anchor-in-html
<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">li</span><span class="p">&gt;&lt;</span><span class="nt">a</span> <span class="na">href</span><span class="o">=</span><span class="s">&quot;url-of-item&quot;</span> <span class="na">title</span><span class="o">=</span><span class="s">&quot;title-of-item&quot;</span><span class="p">&gt;</span>title-of-item<span class="p">&lt;/</span><span class="nt">a</span><span class="p">&gt;&lt;/</span><span class="nt">li</span><span class="p">&gt;</span> </span></pre></div> </td></tr></table>
html

HTML

Twitter Badge HTML

1
2
3
4
5
<div id="twitter_div">
<h2 class="twitter-title">Twitter Updates</h2>
<ul id="twitter_update_list"></ul></div>
<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
<script text="text/javascript" src="http://twitter.com/statuses/user_timeline/yourtwittername.json?callback=twitterCallback2&count=5"></script>
https://snipt.net/embed/5b6e383ec934fc98926cac098d7125f0/
/raw/5b6e383ec934fc98926cac098d7125f0/
5b6e383ec934fc98926cac098d7125f0
html
HTML
5
2019-08-14T02:32:43
True
False
False
/api/public/snipt/2255/
twitter-badge-html
<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="p">&lt;</span><span class="nt">div</span> <span class="na">id</span><span class="o">=</span><span class="s">&quot;twitter_div&quot;</span><span class="p">&gt;</span> </span><span id="L-2"><a name="L-2"></a><span class="p">&lt;</span><span class="nt">h2</span> <span class="na">class</span><span class="o">=</span><span class="s">&quot;twitter-title&quot;</span><span class="p">&gt;</span>Twitter Updates<span class="p">&lt;/</span><span class="nt">h2</span><span class="p">&gt;</span> </span><span id="L-3"><a name="L-3"></a><span class="p">&lt;</span><span class="nt">ul</span> <span class="na">id</span><span class="o">=</span><span class="s">&quot;twitter_update_list&quot;</span><span class="p">&gt;&lt;/</span><span class="nt">ul</span><span class="p">&gt;&lt;/</span><span class="nt">div</span><span class="p">&gt;</span> </span><span id="L-4"><a name="L-4"></a><span class="p">&lt;</span><span class="nt">script</span> <span class="na">type</span><span class="o">=</span><span class="s">&quot;text/javascript&quot;</span> <span class="na">src</span><span class="o">=</span><span class="s">&quot;http://twitter.com/javascripts/blogger.js&quot;</span><span class="p">&gt;&lt;/</span><span class="nt">script</span><span class="p">&gt;</span> </span><span id="L-5"><a name="L-5"></a><span class="p">&lt;</span><span class="nt">script</span> <span class="na">text</span><span class="o">=</span><span class="s">&quot;text/javascript&quot;</span> <span class="na">src</span><span class="o">=</span><span class="s">&quot;http://twitter.com/statuses/user_timeline/yourtwittername.json?callback=twitterCallback2&amp;count=5&quot;</span><span class="p">&gt;&lt;/</span><span class="nt">script</span><span class="p">&gt;</span> </span></pre></div> </td></tr></table>
html, twitter

CSS

Highlight links to PDF and Word files

1
2
3
4
5
6
7
a[href$="pdf"]:after,  
a[href$="doc"]:after {  
margin:0 0 0 5px;  
font:bold 12px "Lucida Grande";  
content: " (PDF)";  
}  
a[href$=".doc"]:after {content: " (DOC)";} 
https://snipt.net/embed/3725c0c3572736f695871721d6849c74/
/raw/3725c0c3572736f695871721d6849c74/
3725c0c3572736f695871721d6849c74
css
CSS
7
2019-07-24T02:32:48
True
False
False
/api/public/snipt/2231/
highlight-links-to-pdf-and-word-files-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> <a href="#L-7">7</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">href</span><span class="o">$=</span><span class="s2">&quot;pdf&quot;</span><span class="o">]</span><span class="nd">:after</span><span class="o">,</span> </span><span id="L-2"><a name="L-2"></a><span class="nt">a</span><span class="o">[</span><span class="nt">href</span><span class="o">$=</span><span class="s2">&quot;doc&quot;</span><span class="o">]</span><span class="nd">:after</span> <span class="p">{</span> </span><span id="L-3"><a name="L-3"></a><span class="nb">margin</span><span class="o">:</span><span class="m">0</span> <span class="m">0</span> <span class="m">0</span> <span class="m">5px</span><span class="p">;</span> </span><span id="L-4"><a name="L-4"></a><span class="nb">font</span><span class="o">:</span><span class="nb">bold</span> <span class="m">12px</span> <span class="s2">&quot;Lucida Grande&quot;</span><span class="p">;</span> </span><span id="L-5"><a name="L-5"></a><span class="nb">content</span><span class="o">:</span> <span class="s2">&quot; (PDF)&quot;</span><span class="p">;</span> </span><span id="L-6"><a name="L-6"></a><span class="p">}</span> </span><span id="L-7"><a name="L-7"></a><span class="nt">a</span><span class="o">[</span><span class="nt">href</span><span class="o">$=</span><span class="s2">&quot;.doc&quot;</span><span class="o">]</span><span class="nd">:after</span> <span class="p">{</span><span class="nb">content</span><span class="o">:</span> <span class="s2">&quot; (DOC)&quot;</span><span class="p">;}</span> </span></pre></div> </td></tr></table>
css, doc, html, links, pdf

PHP

include a php file in a html file

<?php include("filetoinclude.php"); ?>
https://snipt.net/embed/96ca08cb643cec66d90c7bd1158301b9/
/raw/96ca08cb643cec66d90c7bd1158301b9/
96ca08cb643cec66d90c7bd1158301b9
php
PHP
1
2019-08-17T17:16:20
True
False
False
/api/public/snipt/1987/
include-a-php-file-in-a-html-file
<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="cp">&lt;?php</span> <span class="k">include</span><span class="p">(</span><span class="s2">&quot;filetoinclude.php&quot;</span><span class="p">);</span> <span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
html, php, server, web

JavaScript

Disable all forms on a page

1
2
3
4
5
6
7
8
  <script>
    for(i=0; i < document.forms.length; i++) {
      f = $(document.forms[i].id);
      if (f != null) {
        Form.disable(f);
      }
    }
  </script>
https://snipt.net/embed/da80f76e5134380f555112cc93d75687/
/raw/da80f76e5134380f555112cc93d75687/
da80f76e5134380f555112cc93d75687
js
JavaScript
8
2019-07-31T18:26:49
True
False
False
/api/public/snipt/1956/
disable-all-forms-on-a-page
<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> <span class="o">&lt;</span><span class="nx">script</span><span class="o">&gt;</span> </span><span id="L-2"><a name="L-2"></a> <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nb">document</span><span class="p">.</span><span class="nx">forms</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span> </span><span id="L-3"><a name="L-3"></a> <span class="nx">f</span> <span class="o">=</span> <span class="nx">$</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">forms</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">id</span><span class="p">);</span> </span><span id="L-4"><a name="L-4"></a> <span class="k">if</span> <span class="p">(</span><span class="nx">f</span> <span class="o">!=</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span> </span><span id="L-5"><a name="L-5"></a> <span class="nx">Form</span><span class="p">.</span><span class="nx">disable</span><span class="p">(</span><span class="nx">f</span><span class="p">);</span> </span><span id="L-6"><a name="L-6"></a> <span class="p">}</span> </span><span id="L-7"><a name="L-7"></a> <span class="p">}</span> </span><span id="L-8"><a name="L-8"></a> <span class="o">&lt;</span><span class="err">/script&gt;</span> </span></pre></div> </td></tr></table>
forms, html, javascript, prototype

HTML

Favicon

1
2
3
4
<link rel="icon" type="image/png" href="myicon.png" />
	<!--[if IE]>
	<link rel="shortcut icon" type="image/vnd.microsoft.icon" href="myicon.ico" />
	<![endif]-->
https://snipt.net/embed/7751d48df8affa0ec7c8c4f7f50b54cf/
/raw/7751d48df8affa0ec7c8c4f7f50b54cf/
7751d48df8affa0ec7c8c4f7f50b54cf
html
HTML
5
2019-08-14T18:54:47
True
False
False
/api/public/snipt/1952/
favicon-2
<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="p">&lt;</span><span class="nt">link</span> <span class="na">rel</span><span class="o">=</span><span class="s">&quot;icon&quot;</span> <span class="na">type</span><span class="o">=</span><span class="s">&quot;image/png&quot;</span> <span class="na">href</span><span class="o">=</span><span class="s">&quot;myicon.png&quot;</span> <span class="p">/&gt;</span> </span><span id="L-2"><a name="L-2"></a> <span class="c">&lt;!--[if IE]&gt;</span> </span><span id="L-3"><a name="L-3"></a><span class="c"> &lt;link rel=&quot;shortcut icon&quot; type=&quot;image/vnd.microsoft.icon&quot; href=&quot;myicon.ico&quot; /&gt;</span> </span><span id="L-4"><a name="L-4"></a><span class="c"> &lt;![endif]--&gt;</span> </span></pre></div> </td></tr></table>
favicon, html