snipt

Ctrl+h for KB shortcuts

Text only

git - remove file tracking

git rm --cached FILENAME
https://snipt.net/embed/b95f9e34e8e024efa716289d976d771e/
https://snipt.net/raw/b95f9e34e8e024efa716289d976d771e/
b95f9e34e8e024efa716289d976d771e
text
Text only
1
2016-10-01T02:52:08
True
False
False
Oct 04, 2015 at 04:35 PM
/api/public/snipt/141490/
git-remove-file-tracking
<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>git rm --cached FILENAME </span></pre></div> </td></tr></table>
git, remove, tracking

JavaScript

CS Cart - ZBA Z-3010 Scanner Aus Post Express Post tracking code input favlet

1
2
3
4
5
/* CS CART 2.x */
javascript:(function(){/*Scanner Postage Tracking7 Aug 2013Quick fix as the scanner adds 5 numerals at the start of the Australia Post Express Post tracking codes and does a carriage returnRMW Web Publishing*/if($('#content_add_shipment:visible').length>0){var scanned=$('#shipment_comments').val();if(scanned.length>0){scanned=scanned.trim();scanned=scanned.slice(4);/* example '997960402908127094' return 60402908127094 */if(scanned.length===14){$('#tracking_number').val(scanned).focus();$('#shipment_comments').val('');}else{alert('Something sus happened - the code is not correct. Please fix manually');return;}}else{alert('Please scan code into the "Comments" field');}/* Set Carrier to Australia Post */$('#carrier_key option[value="AUP"]').attr('selected','selected');/* Set Order Status to Posted */$('#order_status option[value="C"]').attr('selected','selected');/* Set Notification to True */$('#shipment_notify_user').attr('checked','checked');}else{alert('CS Cart "New Shipment" dialogue not active');}})()

/* CS CART 4.x */
javascript:!function(){!function(){if($('form[name=%22shipments_form%22]:visible').length%3E0){var%20e=$(%22%23shipmentcomments%22).val();if(e.length%3E0){if(e=e.trim(),e=e.slice(4),14!==e.length)return%20void%20alert(%22Somethings%20wrong%20-%20the%20code%20is%20not%20correct.%20Please%20fix%20manually%22);$(%22%23tracking_number%22).val(e).focus(),$(%22%23shipmentcomments%22).val(%22%22)}else%20alert('Please%20scan%20code%20into%20the%20%22Comments%22%20field');$('%23carrier_key%20option[value=%22aup%22]').prop(%22selected%22,!0),$('%23order_status%20option[value=%22C%22]').prop(%22selected%22,!0),$(%22%23shipment_notify_user%22).prop(%22checked%22,!0)}else%20alert('Unable%20to%20find%20CS%20Cart%20%22New%20Shipment%22%20modal')}()}();
https://snipt.net/embed/2693ff9953ca2d4d080614b35ea6a710/
https://snipt.net/raw/2693ff9953ca2d4d080614b35ea6a710/
2693ff9953ca2d4d080614b35ea6a710
js
JavaScript
5
2016-09-30T15:29:36
True
False
False
/api/public/snipt/72417/
cs-cart-zba-z-3010-scanner-aus-post-express-post-tracking-code-input-favlet
<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 id="L-1"><a name="L-1"></a><span class="cm">/* CS CART 2.x */</span> </span><span id="L-2"><a name="L-2"></a><span class="nx">javascript</span><span class="o">:</span><span class="p">(</span><span class="kd">function</span><span class="p">(){</span><span class="cm">/*Scanner Postage Tracking7 Aug 2013Quick fix as the scanner adds 5 numerals at the start of the Australia Post Express Post tracking codes and does a carriage returnRMW Web Publishing*/</span><span class="k">if</span><span class="p">(</span><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;#content_add_shipment:visible&#39;</span><span class="p">).</span><span class="nx">length</span><span class="o">&gt;</span><span class="mi">0</span><span class="p">){</span><span class="kd">var</span> <span class="nx">scanned</span><span class="o">=</span><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;#shipment_comments&#39;</span><span class="p">).</span><span class="nx">val</span><span class="p">();</span><span class="k">if</span><span class="p">(</span><span class="nx">scanned</span><span class="p">.</span><span class="nx">length</span><span class="o">&gt;</span><span class="mi">0</span><span class="p">){</span><span class="nx">scanned</span><span class="o">=</span><span class="nx">scanned</span><span class="p">.</span><span class="nx">trim</span><span class="p">();</span><span class="nx">scanned</span><span class="o">=</span><span class="nx">scanned</span><span class="p">.</span><span class="nx">slice</span><span class="p">(</span><span class="mi">4</span><span class="p">);</span><span class="cm">/* example &#39;997960402908127094&#39; return 60402908127094 */</span><span class="k">if</span><span class="p">(</span><span class="nx">scanned</span><span class="p">.</span><span class="nx">length</span><span class="o">===</span><span class="mi">14</span><span class="p">){</span><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;#tracking_number&#39;</span><span class="p">).</span><span class="nx">val</span><span class="p">(</span><span class="nx">scanned</span><span class="p">).</span><span class="nx">focus</span><span class="p">();</span><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;#shipment_comments&#39;</span><span class="p">).</span><span class="nx">val</span><span class="p">(</span><span class="s1">&#39;&#39;</span><span class="p">);}</span><span class="k">else</span><span class="p">{</span><span class="nx">alert</span><span class="p">(</span><span class="s1">&#39;Something sus happened - the code is not correct. Please fix manually&#39;</span><span class="p">);</span><span class="k">return</span><span class="p">;}}</span><span class="k">else</span><span class="p">{</span><span class="nx">alert</span><span class="p">(</span><span class="s1">&#39;Please scan code into the &quot;Comments&quot; field&#39;</span><span class="p">);}</span><span class="cm">/* Set Carrier to Australia Post */</span><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;#carrier_key option[value=&quot;AUP&quot;]&#39;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s1">&#39;selected&#39;</span><span class="p">,</span><span class="s1">&#39;selected&#39;</span><span class="p">);</span><span class="cm">/* Set Order Status to Posted */</span><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;#order_status option[value=&quot;C&quot;]&#39;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s1">&#39;selected&#39;</span><span class="p">,</span><span class="s1">&#39;selected&#39;</span><span class="p">);</span><span class="cm">/* Set Notification to True */</span><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;#shipment_notify_user&#39;</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s1">&#39;checked&#39;</span><span class="p">,</span><span class="s1">&#39;checked&#39;</span><span class="p">);}</span><span class="k">else</span><span class="p">{</span><span class="nx">alert</span><span class="p">(</span><span class="s1">&#39;CS Cart &quot;New Shipment&quot; dialogue not active&#39;</span><span class="p">);}})()</span> </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="cm">/* CS CART 4.x */</span> </span><span id="L-5"><a name="L-5"></a><span class="nx">javascript</span><span class="o">:!</span><span class="kd">function</span><span class="p">(){</span><span class="o">!</span><span class="kd">function</span><span class="p">(){</span><span class="k">if</span><span class="p">(</span><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;form[name=%22shipments_form%22]:visible&#39;</span><span class="p">).</span><span class="nx">length</span><span class="o">%</span><span class="mi">3</span><span class="nx">E0</span><span class="p">){</span><span class="kd">var</span><span class="o">%</span><span class="mi">20</span><span class="nx">e</span><span class="o">=</span><span class="nx">$</span><span class="p">(</span><span class="o">%</span><span class="mi">22</span><span class="o">%</span><span class="mi">23</span><span class="nx">shipmentcomments</span><span class="o">%</span><span class="mi">22</span><span class="p">).</span><span class="nx">val</span><span class="p">();</span><span class="k">if</span><span class="p">(</span><span class="nx">e</span><span class="p">.</span><span class="nx">length</span><span class="o">%</span><span class="mi">3</span><span class="nx">E0</span><span class="p">){</span><span class="k">if</span><span class="p">(</span><span class="nx">e</span><span class="o">=</span><span class="nx">e</span><span class="p">.</span><span class="nx">trim</span><span class="p">(),</span><span class="nx">e</span><span class="o">=</span><span class="nx">e</span><span class="p">.</span><span class="nx">slice</span><span class="p">(</span><span class="mi">4</span><span class="p">),</span><span class="mi">14</span><span class="o">!==</span><span class="nx">e</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span><span class="k">return</span><span class="o">%</span><span class="mi">20</span><span class="k">void</span><span class="o">%</span><span class="mi">20</span><span class="nx">alert</span><span class="p">(</span><span class="o">%</span><span class="mi">22</span><span class="nx">Somethings</span><span class="o">%</span><span class="mi">20</span><span class="nx">wrong</span><span class="o">%</span><span class="mi">20</span><span class="o">-%</span><span class="mi">20</span><span class="nx">the</span><span class="o">%</span><span class="mi">20</span><span class="nx">code</span><span class="o">%</span><span class="mi">20</span><span class="nx">is</span><span class="o">%</span><span class="mi">20</span><span class="nx">not</span><span class="o">%</span><span class="mi">20</span><span class="nx">correct</span><span class="p">.</span><span class="o">%</span><span class="mi">20</span><span class="nx">Please</span><span class="o">%</span><span class="mi">20</span><span class="nx">fix</span><span class="o">%</span><span class="mi">20</span><span class="nx">manually</span><span class="o">%</span><span class="mi">22</span><span class="p">);</span><span class="nx">$</span><span class="p">(</span><span class="o">%</span><span class="mi">22</span><span class="o">%</span><span class="mi">23</span><span class="nx">tracking_number</span><span class="o">%</span><span class="mi">22</span><span class="p">).</span><span class="nx">val</span><span class="p">(</span><span class="nx">e</span><span class="p">).</span><span class="nx">focus</span><span class="p">(),</span><span class="nx">$</span><span class="p">(</span><span class="o">%</span><span class="mi">22</span><span class="o">%</span><span class="mi">23</span><span class="nx">shipmentcomments</span><span class="o">%</span><span class="mi">22</span><span class="p">).</span><span class="nx">val</span><span class="p">(</span><span class="o">%</span><span class="mi">22</span><span class="o">%</span><span class="mi">22</span><span class="p">)}</span><span class="k">else</span><span class="o">%</span><span class="mi">20</span><span class="nx">alert</span><span class="p">(</span><span class="s1">&#39;Please%20scan%20code%20into%20the%20%22Comments%22%20field&#39;</span><span class="p">);</span><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;%23carrier_key%20option[value=%22aup%22]&#39;</span><span class="p">).</span><span class="nx">prop</span><span class="p">(</span><span class="o">%</span><span class="mi">22</span><span class="nx">selected</span><span class="o">%</span><span class="mi">22</span><span class="p">,</span><span class="o">!</span><span class="mi">0</span><span class="p">),</span><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;%23order_status%20option[value=%22C%22]&#39;</span><span class="p">).</span><span class="nx">prop</span><span class="p">(</span><span class="o">%</span><span class="mi">22</span><span class="nx">selected</span><span class="o">%</span><span class="mi">22</span><span class="p">,</span><span class="o">!</span><span class="mi">0</span><span class="p">),</span><span class="nx">$</span><span class="p">(</span><span class="o">%</span><span class="mi">22</span><span class="o">%</span><span class="mi">23</span><span class="nx">shipment_notify_user</span><span class="o">%</span><span class="mi">22</span><span class="p">).</span><span class="nx">prop</span><span class="p">(</span><span class="o">%</span><span class="mi">22</span><span class="nx">checked</span><span class="o">%</span><span class="mi">22</span><span class="p">,</span><span class="o">!</span><span class="mi">0</span><span class="p">)}</span><span class="k">else</span><span class="o">%</span><span class="mi">20</span><span class="nx">alert</span><span class="p">(</span><span class="s1">&#39;Unable%20to%20find%20CS%20Cart%20%22New%20Shipment%22%20modal&#39;</span><span class="p">)}()}();</span> </span></pre></div> </td></tr></table>
auspost, barcode, bookmarklet, cscart, cscart4, ecommerce, favlet, scanned, shipping, shopping, store, tracking, z-3010

Text only

Google Analytics External Link Tracking

1
2
3
4
5
6
7
function gaExternalLink(link, category, action, label) {
	try {
		var myTracker = _gat._getTrackerByName();
		_gaq.push(['myTracker._trackEvent', category , action, label]);
		setTimeout('document.location = "' + link.href + '"', 100)
	} catch(err) {}
}
https://snipt.net/embed/49ac53887b6751ddc7f1b2d93760439e/
https://snipt.net/raw/49ac53887b6751ddc7f1b2d93760439e/
49ac53887b6751ddc7f1b2d93760439e
text
Text only
7
2016-10-01T00:22:28
True
False
False
Sep 04, 2012 at 10:49 PM
/api/public/snipt/46700/
google-analytics-external-link-tracking
<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 id="L-1"><a name="L-1"></a>function gaExternalLink(link, category, action, label) { </span><span id="L-2"><a name="L-2"></a> try { </span><span id="L-3"><a name="L-3"></a> var myTracker = _gat._getTrackerByName(); </span><span id="L-4"><a name="L-4"></a> _gaq.push([&#39;myTracker._trackEvent&#39;, category , action, label]); </span><span id="L-5"><a name="L-5"></a> setTimeout(&#39;document.location = &quot;&#39; + link.href + &#39;&quot;&#39;, 100) </span><span id="L-6"><a name="L-6"></a> } catch(err) {} </span><span id="L-7"><a name="L-7"></a>} </span></pre></div> </td></tr></table>
GoogleAnalytics, ga, link, stats, tracking

JavaScript

create cookie in browser with FireBug

1
2
3
4
5
6
7
// go to your website where do you want to add the cookie
// open Console in FireBug:
>>> __utmSetVar
__utmSetVar(v)
>>> __utmSetVar('testCookie1234567890')
>>> document.cookie
"…; …; ….testCookie1234567890; …; …"
https://snipt.net/embed/91ab129de93ea7f12f62fa7aea0dd8a0/
https://snipt.net/raw/91ab129de93ea7f12f62fa7aea0dd8a0/
91ab129de93ea7f12f62fa7aea0dd8a0
js
JavaScript
7
2016-09-30T20:28:58
True
False
False
/api/public/snipt/9670/
create-cookie-in-browser-with-firebug
<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 id="L-1"><a name="L-1"></a><span class="c1">// go to your website where do you want to add the cookie</span> </span><span id="L-2"><a name="L-2"></a><span class="c1">// open Console in FireBug:</span> </span><span id="L-3"><a name="L-3"></a><span class="o">&gt;&gt;&gt;</span> <span class="nx">__utmSetVar</span> </span><span id="L-4"><a name="L-4"></a><span class="nx">__utmSetVar</span><span class="p">(</span><span class="nx">v</span><span class="p">)</span> </span><span id="L-5"><a name="L-5"></a><span class="o">&gt;&gt;&gt;</span> <span class="nx">__utmSetVar</span><span class="p">(</span><span class="s1">&#39;testCookie1234567890&#39;</span><span class="p">)</span> </span><span id="L-6"><a name="L-6"></a><span class="o">&gt;&gt;&gt;</span> <span class="nb">document</span><span class="p">.</span><span class="nx">cookie</span> </span><span id="L-7"><a name="L-7"></a><span class="s2">&quot;…; …; ….testCookie1234567890; …; …&quot;</span> </span></pre></div> </td></tr></table>
analytics, browser, cookie, stats, tracking, visit

HTML

google track exit clicks

<a href="http://www.advertisersite.com" onClick="javascript: pageTracker._trackPageview
('/bannerads/advertisername/bannername');">
https://snipt.net/embed/bf67394620aa304edb6fc8c8cd310194/
https://snipt.net/raw/bf67394620aa304edb6fc8c8cd310194/
bf67394620aa304edb6fc8c8cd310194
html
HTML
2
2016-09-21T16:38:33
True
False
False
Feb 23, 2013 at 07:02 PM
/api/public/snipt/2242/
google-track-exit-clicks
<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 id="L-1"><a name="L-1"></a><span class="nt">&lt;a</span> <span class="na">href=</span><span class="s">&quot;http://www.advertisersite.com&quot;</span> <span class="na">onClick=</span><span class="s">&quot;javascript: pageTracker._trackPageview</span> </span><span id="L-2"><a name="L-2"></a><span class="s">(&#39;/bannerads/advertisername/bannername&#39;);&quot;</span><span class="nt">&gt;</span> </span></pre></div> </td></tr></table>
analytics, google, tracking
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.