snipt

Ctrl+h for KB shortcuts

Bash

SASS watch changes script for Windows (save in .bat file and run)

sass --watch "style.scss":"style.css"
https://snipt.net/embed/77e83aeeaa6abe96bfcac18e763f222c/
/raw/77e83aeeaa6abe96bfcac18e763f222c/
77e83aeeaa6abe96bfcac18e763f222c
bash
Bash
1
2019-05-23T00:19:54
True
False
False
Feb 12, 2013 at 01:16 PM
/api/public/snipt/48431/
sass-watch-changes-script-for-windows-save-in-bat-file-and-run
<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>sass --watch <span class="s2">&quot;style.scss&quot;</span>:<span class="s2">&quot;style.css&quot;</span> </span></pre></div> </td></tr></table>
css, ruby, sass, webdev, windows

Bash

SASS watch changes script for OS X (save in .command file and run)

cd $(dirname "$0")
sass --watch "style.scss":"style.css"
https://snipt.net/embed/545eedf4c165272bbce7e4b217c0d2e2/
/raw/545eedf4c165272bbce7e4b217c0d2e2/
545eedf4c165272bbce7e4b217c0d2e2
bash
Bash
2
2016-12-29T18:36:25
True
False
True
Feb 12, 2013 at 01:17 PM
/api/public/snipt/48430/
sass-watch-changes-script-for-os-x-save-in-command-file-and-run
<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="nb">cd</span> <span class="k">$(</span>dirname <span class="s2">&quot;</span><span class="nv">$0</span><span class="s2">&quot;</span><span class="k">)</span> </span><span id="L-2"><a name="L-2"></a>sass --watch <span class="s2">&quot;style.scss&quot;</span>:<span class="s2">&quot;style.css&quot;</span> </span></pre></div> </td></tr></table>
"os x", css, ruby, sass, webdev

JavaScript

Clear CSS cache in Firefox bookmarklet

javascript:void(function(){var%20i,a,s;a=document.getElementsByTagName('link');for(i=0;i<a.length;i++){s=a[i];if(s.rel.toLowerCase().indexOf('stylesheet')>=0&&s.href)%20{var%20h=s.href.replace(/(&|%5C?)forceReload=d+/,'');s.href=h+(h.indexOf('?')>=0?'&':'?')+'forceReload='+(new%20Date().valueOf())}}})();
https://snipt.net/embed/6aeca59c5b12172f0ddadf09d40acd3c/
/raw/6aeca59c5b12172f0ddadf09d40acd3c/
6aeca59c5b12172f0ddadf09d40acd3c
js
JavaScript
1
2019-05-23T06:10:10
True
False
False
Aug 25, 2012 at 04:58 AM
/api/public/snipt/46283/
clear-css-cache-in-firefox-bookmarklet
<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="nx">javascript</span><span class="o">:</span><span class="k">void</span><span class="p">(</span><span class="kd">function</span><span class="p">(){</span><span class="kd">var</span><span class="o">%</span><span class="mi">20</span><span class="nx">i</span><span class="p">,</span><span class="nx">a</span><span class="p">,</span><span class="nx">s</span><span class="p">;</span><span class="nx">a</span><span class="o">=</span><span class="nb">document</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;link&#39;</span><span class="p">);</span><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="nx">a</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="nx">s</span><span class="o">=</span><span class="nx">a</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span><span class="k">if</span><span class="p">(</span><span class="nx">s</span><span class="p">.</span><span class="nx">rel</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">().</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;stylesheet&#39;</span><span class="p">)</span><span class="o">&gt;=</span><span class="mi">0</span><span class="o">&amp;&amp;</span><span class="nx">s</span><span class="p">.</span><span class="nx">href</span><span class="p">)</span><span class="o">%</span><span class="mi">20</span><span class="p">{</span><span class="kd">var</span><span class="o">%</span><span class="mi">20</span><span class="nx">h</span><span class="o">=</span><span class="nx">s</span><span class="p">.</span><span class="nx">href</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/(&amp;|%5C?)forceReload=d+/</span><span class="p">,</span><span class="s1">&#39;&#39;</span><span class="p">);</span><span class="nx">s</span><span class="p">.</span><span class="nx">href</span><span class="o">=</span><span class="nx">h</span><span class="o">+</span><span class="p">(</span><span class="nx">h</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s1">&#39;?&#39;</span><span class="p">)</span><span class="o">&gt;=</span><span class="mi">0</span><span class="o">?</span><span class="s1">&#39;&amp;&#39;</span><span class="o">:</span><span class="s1">&#39;?&#39;</span><span class="p">)</span><span class="o">+</span><span class="s1">&#39;forceReload=&#39;</span><span class="o">+</span><span class="p">(</span><span class="k">new</span><span class="o">%</span><span class="mi">20</span><span class="nb">Date</span><span class="p">().</span><span class="nx">valueOf</span><span class="p">())}}})();</span> </span></pre></div> </td></tr></table>
bookmarklet, cache, css

JavaScript

Target IE6-8 with JQuery

1
2
3
4
5
//http://webknight-nz.blogspot.com/2011/03/ie-9-detection-with-jquery.html
if(!$.support.htmlSerialize && !$.support.opacity) 
{
// IE6/7/8 code
}
https://snipt.net/embed/ca30f7f02d18f5b166d6514578d4b062/
/raw/ca30f7f02d18f5b166d6514578d4b062/
ca30f7f02d18f5b166d6514578d4b062
js
JavaScript
5
2019-05-20T04:05:06
True
False
False
Feb 12, 2013 at 01:24 PM
/api/public/snipt/43201/
target-ie6-8-with-jquery
<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">//http://webknight-nz.blogspot.com/2011/03/ie-9-detection-with-jquery.html</span> </span><span id="L-2"><a name="L-2"></a><span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">$</span><span class="p">.</span><span class="nx">support</span><span class="p">.</span><span class="nx">htmlSerialize</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">$</span><span class="p">.</span><span class="nx">support</span><span class="p">.</span><span class="nx">opacity</span><span class="p">)</span> </span><span id="L-3"><a name="L-3"></a><span class="p">{</span> </span><span id="L-4"><a name="L-4"></a><span class="c1">// IE6/7/8 code</span> </span><span id="L-5"><a name="L-5"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
browser, jquery