snipt

Ctrl+h for KB shortcuts

Text only

Register JS

1
2
3
4
5
	$js = <<<JS
		
JS;

	$this->registerJs($js);
https://snipt.net/embed/675cab96f7025971f25ce9d49158987a/
/raw/675cab96f7025971f25ce9d49158987a/
675cab96f7025971f25ce9d49158987a
text
Text only
6
2019-06-13T17:09:41
True
False
False
Oct 20, 2016 at 06:29 PM
/api/public/snipt/148028/
register-js
<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> $js = &lt;&lt;&lt;JS </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>JS; </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a> $this-&gt;registerJs($js); </span></pre></div> </td></tr></table>
yii

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/
/raw/ad55330d8c79709d50697430965a79a7/
ad55330d8c79709d50697430965a79a7
text
Text only
4
2019-06-13T08:45:54
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></span><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

ionic link

<a href="#/app/privacy">
https://snipt.net/embed/522d98c8977fbab70f716adfe325bdfd/
/raw/522d98c8977fbab70f716adfe325bdfd/
522d98c8977fbab70f716adfe325bdfd
text
Text only
1
2019-06-08T09:54:42
True
False
False
Jun 27, 2016 at 08:57 PM
/api/public/snipt/147293/
ionic-link
<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>&lt;a href=&quot;#/app/privacy&quot;&gt; </span></pre></div> </td></tr></table>
angular, ionic

Text only

JavaScript Foreach

1
2
3
for (var i in bearings){
	var item = bearings[i];
}
https://snipt.net/embed/39a60d2021270ce207df97bf0a5cd4f5/
/raw/39a60d2021270ce207df97bf0a5cd4f5/
39a60d2021270ce207df97bf0a5cd4f5
text
Text only
4
2019-06-13T08:47:15
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></span><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

Text only

Ionic Disable back button

1
2
3
4
5
$ionicHistory.nextViewOptions({
  disableBack: true,
  disableAnimate: true
});
$state.go('app.home');
https://snipt.net/embed/b8571b32a28c397df7834852239ac1f5/
/raw/b8571b32a28c397df7834852239ac1f5/
b8571b32a28c397df7834852239ac1f5
text
Text only
6
2019-06-07T11:40:17
True
False
False
Jun 22, 2016 at 12:22 AM
/api/public/snipt/147270/
ionic-disable-back-button
<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>$ionicHistory.nextViewOptions({ </span><span id="L-2"><a name="L-2"></a> disableBack: true, </span><span id="L-3"><a name="L-3"></a> disableAnimate: true </span><span id="L-4"><a name="L-4"></a>}); </span><span id="L-5"><a name="L-5"></a>$state.go(&#39;app.home&#39;); </span></pre></div> </td></tr></table>
ionic

Text only

PHP Unset all variables

foreach (array_keys($GLOBALS) as $k) unset($$k);
unset($k);
https://snipt.net/embed/3dc502278b0f6993c73ed871cd80a420/
/raw/3dc502278b0f6993c73ed871cd80a420/
3dc502278b0f6993c73ed871cd80a420
text
Text only
3
2019-06-15T11:39:33
True
False
False
Jun 20, 2016 at 06:27 PM
/api/public/snipt/147262/
php-unset-all-variables
<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>foreach (array_keys($GLOBALS) as $k) unset($$k); </span><span id="L-2"><a name="L-2"></a>unset($k); </span></pre></div> </td></tr></table>
php

Text only

Default Timestamp

 `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
https://snipt.net/embed/f99dbed8067d0e301a66b517e6eac47a/
/raw/f99dbed8067d0e301a66b517e6eac47a/
f99dbed8067d0e301a66b517e6eac47a
text
Text only
1
2019-06-05T09:01:10
True
False
False
May 25, 2016 at 04:41 PM
/api/public/snipt/147048/
default-timestamp
<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> `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP </span></pre></div> </td></tr></table>
mysqli