snipt

Ctrl+h for KB shortcuts

Text only

Date Today

1
2
3
    var date = new Date();
    var today = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
    var today_formated = (date.getMonth() + 1) + '/' + date.getDate() + '/' + date.getFullYear();
https://snipt.net/embed/ad55330d8c79709d50697430965a79a7/
https://snipt.net/raw/ad55330d8c79709d50697430965a79a7/
ad55330d8c79709d50697430965a79a7
text
Text only
4
2016-07-26T16:46:14
True
False
False
/api/public/snipt/147414/
date-today
<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> var date = new Date(); </span><span id="L-2"><a name="L-2"></a> var today = date.getFullYear() + &#39;-&#39; + (date.getMonth() + 1) + &#39;-&#39; + date.getDate(); </span><span id="L-3"><a name="L-3"></a> var today_formated = (date.getMonth() + 1) + &#39;/&#39; + date.getDate() + &#39;/&#39; + date.getFullYear(); </span></pre></div> </td></tr></table>
javascript

Text only

JavaScript Foreach

1
2
3
for (var i in bearings){
	var item = bearings[i];
}
https://snipt.net/embed/39a60d2021270ce207df97bf0a5cd4f5/
https://snipt.net/raw/39a60d2021270ce207df97bf0a5cd4f5/
39a60d2021270ce207df97bf0a5cd4f5
text
Text only
4
2016-07-26T12:42:27
True
False
False
/api/public/snipt/147285/
javascript-foreach-ad42fdc9
<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>for (var i in bearings){ </span><span id="L-2"><a name="L-2"></a> var item = bearings[i]; </span><span id="L-3"><a name="L-3"></a>} </span></pre></div> </td></tr></table>
javascript

JavaScript

Inject jQuery into Chrome console

1
2
3
4
5
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load, then type.
jQuery.noConflict();
https://snipt.net/embed/f550f796f2c31b07a2a64f57e29ca03d/
https://snipt.net/raw/f550f796f2c31b07a2a64f57e29ca03d/
f550f796f2c31b07a2a64f57e29ca03d
js
JavaScript
5
2016-07-26T18:43:10
True
False
False
Apr 04, 2016 at 02:09 PM
/api/public/snipt/145151/
inject-jquery-into-chrome-console
<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="kd">var</span> <span class="nx">jq</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;script&#39;</span><span class="p">);</span> </span><span id="L-2"><a name="L-2"></a><span class="nx">jq</span><span class="p">.</span><span class="nx">src</span> <span class="o">=</span> <span class="s2">&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js&quot;</span><span class="p">;</span> </span><span id="L-3"><a name="L-3"></a><span class="nb">document</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;head&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">].</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">jq</span><span class="p">);</span> </span><span id="L-4"><a name="L-4"></a><span class="c1">// ... give time for script to load, then type.</span> </span><span id="L-5"><a name="L-5"></a><span class="nx">jQuery</span><span class="p">.</span><span class="nx">noConflict</span><span class="p">();</span> </span></pre></div> </td></tr></table>
Chrome, jQuery, javascript
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.