snipt

Ctrl+h for KB shortcuts

Text only

Checking which ES6 features are supported by NodeJS

node --v8-options | grep harmony
https://snipt.net/embed/879f10c855416ad18f4aba097095f996/
https://snipt.net/raw/879f10c855416ad18f4aba097095f996/
879f10c855416ad18f4aba097095f996
text
Text only
1
2016-09-28T03:19:40
True
False
False
Oct 12, 2015 at 02:19 AM
/api/public/snipt/141626/
checking-which-es6-features-are-supported-by-nodejs
<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>node --v8-options | grep harmony </span></pre></div> </td></tr></table>
cli, es6, harmony, node

Bash

svn update with no interaction and accept certificate from cli

svn up --username <user> --password <psw> --non-interactive --trust-server-cert
https://snipt.net/embed/8ee9a30e7f44092e596ab7820a8c1502/
https://snipt.net/raw/8ee9a30e7f44092e596ab7820a8c1502/
8ee9a30e7f44092e596ab7820a8c1502
bash
Bash
1
2016-09-29T07:49:12
True
False
False
Jul 19, 2013 at 09:24 AM
/api/public/snipt/68603/
svn-update-with-no-interaction-and-accept-certificate-from-cli
<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>svn up --username &lt;user&gt; --password &lt;psw&gt; --non-interactive --trust-server-cert </span></pre></div> </td></tr></table>
accept, certificate, cli, command, line, linux, shell, svn, up, update

PHP

Protect CLI scripts from Server call

1
2
3
4
5
//lock only from CLI mode, usually for cronjobs left in public !! Do not make this !
if (strpos(strtolower(PHP_SAPI),'cli') === false)
{
    die(0);
}
https://snipt.net/embed/96d4e65f5f66c98e58458fb5949820f1/
https://snipt.net/raw/96d4e65f5f66c98e58458fb5949820f1/
96d4e65f5f66c98e58458fb5949820f1
php
PHP
5
2016-09-26T11:27:15
True
False
False
Mar 13, 2013 at 04:54 PM
/api/public/snipt/57570/
protect-cli-scripts-from-server-call
<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="x">//lock only from CLI mode, usually for cronjobs left in public !! Do not make this !</span> </span><span id="L-2"><a name="L-2"></a><span class="x">if (strpos(strtolower(PHP_SAPI),&#39;cli&#39;) === false)</span> </span><span id="L-3"><a name="L-3"></a><span class="x">{</span> </span><span id="L-4"><a name="L-4"></a><span class="x"> die(0);</span> </span><span id="L-5"><a name="L-5"></a><span class="x">}</span> </span></pre></div> </td></tr></table>
cli, cronjob, server

Bash

toilet clock

while true; do echo -e "$(date '+%D %T' | toilet -f term -F border --gay)\033[3A"; sleep 1; done
https://snipt.net/embed/4e4ebd75ab15cf50c706d1d07b822df3/
https://snipt.net/raw/4e4ebd75ab15cf50c706d1d07b822df3/
4e4ebd75ab15cf50c706d1d07b822df3
bash
Bash
1
2016-09-22T03:12:45
True
False
False
Jan 04, 2013 at 11:17 AM
/api/public/snipt/52771/
toilet-clock
<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="k">while</span> <span class="nb">true</span><span class="p">;</span> <span class="k">do</span> <span class="nb">echo</span> -e <span class="s2">&quot;</span><span class="k">$(</span>date <span class="s1">&#39;+%D %T&#39;</span> <span class="p">|</span> toilet -f term -F border --gay<span class="k">)</span><span class="s2">\033[3A&quot;</span><span class="p">;</span> sleep 1<span class="p">;</span> <span class="k">done</span> </span></pre></div> </td></tr></table>
bash, cli, linux, toilet

Bash

figlet clock

watch -n1 "date '+%D%n%T'|figlet -k"
https://snipt.net/embed/a9e57e741c4305beefd84ddabc4c6bc7/
https://snipt.net/raw/a9e57e741c4305beefd84ddabc4c6bc7/
a9e57e741c4305beefd84ddabc4c6bc7
bash
Bash
1
2016-09-25T00:36:39
True
False
False
/api/public/snipt/52770/
figlet-clock
<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>watch -n1 <span class="s2">&quot;date &#39;+%D%n%T&#39;|figlet -k&quot;</span> </span></pre></div> </td></tr></table>
bash, cli, figlet
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.