snipt

Ctrl+h for KB shortcuts

Bash

osx > flush dns cache

$ dscacheutil -flushcache
https://snipt.net/embed/8139c2018d1c4f8176780099894617cf/
https://snipt.net/raw/8139c2018d1c4f8176780099894617cf/
8139c2018d1c4f8176780099894617cf
bash
Bash
1
2016-09-27T17:33:19
True
False
False
Aug 04, 2013 at 02:13 PM
/api/public/snipt/71809/
osx-flush-dns-cache
<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 id="L-1"><a name="L-1"></a><span class="nv">$ </span>dscacheutil -flushcache </span></pre></div> </td></tr></table>
cache, dns, osx

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/
https://snipt.net/raw/6aeca59c5b12172f0ddadf09d40acd3c/
6aeca59c5b12172f0ddadf09d40acd3c
js
JavaScript
1
2016-09-25T14:09:33
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 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

Bash

flush computer cache

dscacheutil -flushcache
https://snipt.net/embed/462147d9a8d2b1562064c4b45d5b8223/
https://snipt.net/raw/462147d9a8d2b1562064c4b45d5b8223/
462147d9a8d2b1562064c4b45d5b8223
bash
Bash
1
2016-09-22T02:50:06
True
False
False
/api/public/snipt/34168/
flush-computer-cache
<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 id="L-1"><a name="L-1"></a>dscacheutil -flushcache </span></pre></div> </td></tr></table>
cache, flush, local

PHP

Check if PHP APC cache extension is installed and enabled

1
2
3
<?php
//define a constant, and use it in your class/script
define('APC_EXTENSION_LOADED', extension_loaded('apc') && ini_get('apc.enabled'));
https://snipt.net/embed/119f5882487b031a0f77f7622ff4a10d/
https://snipt.net/raw/119f5882487b031a0f77f7622ff4a10d/
119f5882487b031a0f77f7622ff4a10d
php
PHP
3
2016-09-28T11:39:43
True
False
False
/api/public/snipt/29754/
check-if-php-apc-cache-extension-is-installed-and-enabled
<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 id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a><span class="c1">//define a constant, and use it in your class/script</span> </span><span id="L-3"><a name="L-3"></a><span class="nb">define</span><span class="p">(</span><span class="s1">&#39;APC_EXTENSION_LOADED&#39;</span><span class="p">,</span> <span class="nb">extension_loaded</span><span class="p">(</span><span class="s1">&#39;apc&#39;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nb">ini_get</span><span class="p">(</span><span class="s1">&#39;apc.enabled&#39;</span><span class="p">));</span> </span></pre></div> </td></tr></table>
apc, cache, php
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.