snipt

Ctrl+h for KB shortcuts

HTML

Well Formed Meta Tags

1
2
3
4
5
6
7
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="abstract" content="" />
<meta http-equiv="last-modified" content="Mon, 1 Jan 2009 12:00:00 -0700" />
https://snipt.net/embed/159c78dafb1bf447d9c564a72537223d/
/raw/159c78dafb1bf447d9c564a72537223d/
159c78dafb1bf447d9c564a72537223d
html
HTML
7
2019-07-13T00:03:22
True
False
False
/api/public/snipt/7211/
well-formed-meta-tags
<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="p">&lt;</span><span class="nt">meta</span> <span class="na">http-equiv</span><span class="o">=</span><span class="s">&quot;Content-Script-Type&quot;</span> <span class="na">content</span><span class="o">=</span><span class="s">&quot;text/javascript&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">meta</span> <span class="na">http-equiv</span><span class="o">=</span><span class="s">&quot;Content-Style-Type&quot;</span> <span class="na">content</span><span class="o">=</span><span class="s">&quot;text/css&quot;</span> <span class="p">/&gt;</span> </span><span id="L-3"><a name="L-3"></a><span class="p">&lt;</span><span class="nt">meta</span> <span class="na">http-equiv</span><span class="o">=</span><span class="s">&quot;Content-Type&quot;</span> <span class="na">content</span><span class="o">=</span><span class="s">&quot;text/html; charset=UTF-8&quot;</span> <span class="p">/&gt;</span> </span><span id="L-4"><a name="L-4"></a><span class="p">&lt;</span><span class="nt">meta</span> <span class="na">name</span><span class="o">=</span><span class="s">&quot;keywords&quot;</span> <span class="na">content</span><span class="o">=</span><span class="s">&quot;&quot;</span> <span class="p">/&gt;</span> </span><span id="L-5"><a name="L-5"></a><span class="p">&lt;</span><span class="nt">meta</span> <span class="na">name</span><span class="o">=</span><span class="s">&quot;description&quot;</span> <span class="na">content</span><span class="o">=</span><span class="s">&quot;&quot;</span> <span class="p">/&gt;</span> </span><span id="L-6"><a name="L-6"></a><span class="p">&lt;</span><span class="nt">meta</span> <span class="na">name</span><span class="o">=</span><span class="s">&quot;abstract&quot;</span> <span class="na">content</span><span class="o">=</span><span class="s">&quot;&quot;</span> <span class="p">/&gt;</span> </span><span id="L-7"><a name="L-7"></a><span class="p">&lt;</span><span class="nt">meta</span> <span class="na">http-equiv</span><span class="o">=</span><span class="s">&quot;last-modified&quot;</span> <span class="na">content</span><span class="o">=</span><span class="s">&quot;Mon, 1 Jan 2009 12:00:00 -0700&quot;</span> <span class="p">/&gt;</span> </span></pre></div> </td></tr></table>
date, head, meta

HTML

Update IE6 Script

<!--[if IE 6]><script type="text/javascript">if(typeof jQuery == 'undefined'){ document.write("<script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js\"></"+"script>"); var __noconflict = true; } var IE6UPDATE_OPTIONS = {icons_path: "http://static.ie6update.com/hosted/ie6update/images/"}</script>
  <script type="text/javascript" src="http://static.ie6update.com/hosted/ie6update/ie6update.js"></script><![endif]-->
https://snipt.net/embed/0ff874337308f613cf0f36482c261c61/
/raw/0ff874337308f613cf0f36482c261c61/
0ff874337308f613cf0f36482c261c61
html
HTML
2
2019-06-12T07:59:30
True
False
False
/api/public/snipt/6175/
update-ie6-script
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c">&lt;!--[if IE 6]&gt;&lt;script type=&quot;text/javascript&quot;&gt;if(typeof jQuery == &#39;undefined&#39;){ document.write(&quot;&lt;script type=\&quot;text/javascript\&quot; src=\&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js\&quot;&gt;&lt;/&quot;+&quot;script&gt;&quot;); var __noconflict = true; } var IE6UPDATE_OPTIONS = {icons_path: &quot;http://static.ie6update.com/hosted/ie6update/images/&quot;}&lt;/script&gt;</span> </span><span id="L-2"><a name="L-2"></a><span class="c"> &lt;script type=&quot;text/javascript&quot; src=&quot;http://static.ie6update.com/hosted/ie6update/ie6update.js&quot;&gt;&lt;/script&gt;&lt;![endif]--&gt;</span> </span></pre></div> </td></tr></table>
ie, javascript, js, script

PHP

GZIP for Godaddy

<?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); ?>
https://snipt.net/embed/b446382ddaa36e6103f36b0834cd001b/
/raw/b446382ddaa36e6103f36b0834cd001b/
b446382ddaa36e6103f36b0834cd001b
php
PHP
1
2019-06-30T20:23:07
True
False
False
/api/public/snipt/6147/
gzip-for-godaddy
<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">if</span> <span class="p">(</span><span class="nb">substr_count</span><span class="p">(</span><span class="nv">$_SERVER</span><span class="p">[</span><span class="s1">&#39;HTTP_ACCEPT_ENCODING&#39;</span><span class="p">],</span> <span class="s1">&#39;gzip&#39;</span><span class="p">))</span> <span class="nb">ob_start</span><span class="p">(</span><span class="s2">&quot;ob_gzhandler&quot;</span><span class="p">);</span> <span class="k">else</span> <span class="nb">ob_start</span><span class="p">();</span> <span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
gzip, head, php

Lighttpd configuration file

GZIP CSS .htaccess

1
2
3
AddHandler application/x-httpd-php .css
php_value auto_prepend_file gzip-css.php
php_flag zlib.output_compression On
https://snipt.net/embed/9022595fbbea5e2dbf6a587310e813b3/
/raw/9022595fbbea5e2dbf6a587310e813b3/
9022595fbbea5e2dbf6a587310e813b3
lighty
Lighttpd configuration file
3
2019-06-28T02:00:43
True
False
False
/api/public/snipt/6146/
gzip-css-htaccess
<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><span class="k">AddHandler</span> <span class="k">application</span><span class="n">/x-httpd-php</span> <span class="k">.css</span> </span><span id="L-2"><a name="L-2"></a><span class="k">php_value</span> <span class="k">auto_prepend_file</span> <span class="k">gzip-css.php</span> </span><span id="L-3"><a name="L-3"></a><span class="k">php_flag</span> <span class="k">zlib.output_compression</span> <span class="k">On</span> </span></pre></div> </td></tr></table>
css, gzip, server

PHP

gzip-css.php

1
2
3
4
5
6
7
8
ob_start ("ob_gzhandler");
header("Content-type: text/css; charset: UTF-8");
header("Cache-Control: must-revalidate");
$offset = 60 * 60 ;
$ExpStr = "Expires: " . 
gmdate("D, d M Y H:i:s",
time() + $offset) . " GMT";
header($ExpStr);
https://snipt.net/embed/746f24c16926805703d1314032afac64/
/raw/746f24c16926805703d1314032afac64/
746f24c16926805703d1314032afac64
php
PHP
8
2019-07-12T13:51:58
True
False
False
/api/public/snipt/6145/
gzip-cssphp
<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="x">ob_start (&quot;ob_gzhandler&quot;);</span> </span><span id="L-2"><a name="L-2"></a><span class="x">header(&quot;Content-type: text/css; charset: UTF-8&quot;);</span> </span><span id="L-3"><a name="L-3"></a><span class="x">header(&quot;Cache-Control: must-revalidate&quot;);</span> </span><span id="L-4"><a name="L-4"></a><span class="x">$offset = 60 * 60 ;</span> </span><span id="L-5"><a name="L-5"></a><span class="x">$ExpStr = &quot;Expires: &quot; . </span> </span><span id="L-6"><a name="L-6"></a><span class="x">gmdate(&quot;D, d M Y H:i:s&quot;,</span> </span><span id="L-7"><a name="L-7"></a><span class="x">time() + $offset) . &quot; GMT&quot;;</span> </span><span id="L-8"><a name="L-8"></a><span class="x">header($ExpStr);</span> </span></pre></div> </td></tr></table>
css, gzip, php

CSS

Remove Firefox Link Border

a:active { outline: none; }
a:focus { -moz-outline-style: none; }
https://snipt.net/embed/fd4d5d45ff6a73392656ce1ef6a3a4e5/
/raw/fd4d5d45ff6a73392656ce1ef6a3a4e5/
fd4d5d45ff6a73392656ce1ef6a3a4e5
css
CSS
2
2019-07-15T12:30:33
True
False
False
/api/public/snipt/6144/
remove-firefox-link-border
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</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">:active</span> <span class="p">{</span> <span class="nb">outline</span><span class="o">:</span> <span class="nb">none</span><span class="p">;</span> <span class="p">}</span> </span><span id="L-2"><a name="L-2"></a><span class="nt">a</span><span class="nd">:focus</span> <span class="p">{</span> <span class="o">-</span><span class="n">moz</span><span class="o">-</span><span class="nb">outline-style</span><span class="o">:</span> <span class="nb">none</span><span class="p">;</span> <span class="p">}</span> </span></pre></div> </td></tr></table>
border, css, firefox

PHP

PHP Absolute Server Address

<?php $domain = 'http://www.'.$_SERVER["SERVER_NAME"]; ?>
https://snipt.net/embed/3399f6bb63ba3a8d1b29bb653d36268d/
/raw/3399f6bb63ba3a8d1b29bb653d36268d/
3399f6bb63ba3a8d1b29bb653d36268d
php
PHP
1
2019-07-10T07:26:27
True
False
False
/api/public/snipt/6101/
php-absolute-server-address
<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="nv">$domain</span> <span class="o">=</span> <span class="s1">&#39;http://www.&#39;</span><span class="o">.</span><span class="nv">$_SERVER</span><span class="p">[</span><span class="s2">&quot;SERVER_NAME&quot;</span><span class="p">];</span> <span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
absolute, domain, php, server

HTML

iPhone CSS

<link media="only screen and (max-device-width: 480px)" 
    href="../_css/iPhone.css" type="text/css" rel="stylesheet" />
https://snipt.net/embed/1ad030b77a40fe9a94854f2ae08df5c0/
/raw/1ad030b77a40fe9a94854f2ae08df5c0/
1ad030b77a40fe9a94854f2ae08df5c0
html
HTML
2
2019-07-13T15:54:05
True
False
False
/api/public/snipt/6093/
iphone-css
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</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">media</span><span class="o">=</span><span class="s">&quot;only screen and (max-device-width: 480px)&quot;</span> </span><span id="L-2"><a name="L-2"></a> <span class="na">href</span><span class="o">=</span><span class="s">&quot;../_css/iPhone.css&quot;</span> <span class="na">type</span><span class="o">=</span><span class="s">&quot;text/css&quot;</span> <span class="na">rel</span><span class="o">=</span><span class="s">&quot;stylesheet&quot;</span> <span class="p">/&gt;</span> </span></pre></div> </td></tr></table>
css, iphone, mobile

HTML

IE & IE8 Stylesheet Links

  <!--[if lte IE 7]><link rel="stylesheet" href="../_css/ie.css" type="text/css" /><![endif]-->
  <!--[if IE 8]><link rel="stylesheet" href="../_css/ie8.css" type="text/css" /><![endif]-->
https://snipt.net/embed/d3b29966a7095dc9593455ed06a98f55/
/raw/d3b29966a7095dc9593455ed06a98f55/
d3b29966a7095dc9593455ed06a98f55
html
HTML
2
2019-07-15T10:26:19
True
False
False
/api/public/snipt/6092/
ie-ie8-stylesheet-links
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a> <span class="c">&lt;!--[if lte IE 7]&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;../_css/ie.css&quot; type=&quot;text/css&quot; /&gt;&lt;![endif]--&gt;</span> </span><span id="L-2"><a name="L-2"></a> <span class="c">&lt;!--[if IE 8]&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;../_css/ie8.css&quot; type=&quot;text/css&quot; /&gt;&lt;![endif]--&gt;</span> </span></pre></div> </td></tr></table>
conditional, css, ie