snipt

Ctrl+h for KB shortcuts

Perl

calculate elapsed time (in ms) in Perl code

1
2
3
4
5
use Time::HiRes;

my $t_start = [Time::HiRes::gettimeofday];
my $t_end = [Time::HiRes::gettimeofday];
print Time::HiRes::tv_interval ($t_start, $t_end) . "\n";
https://snipt.net/embed/a8fafdd82bee992cfa9efc11737e4019/
/raw/a8fafdd82bee992cfa9efc11737e4019/
a8fafdd82bee992cfa9efc11737e4019
perl
Perl
5
2019-05-20T08:48:16
True
False
False
/api/public/snipt/3772/
calculate-elapsed-time-in-ms-in-perl-code
<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><span class="k">use</span> <span class="nn">Time::</span><span class="n">HiRes</span><span class="p">;</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="k">my</span> <span class="nv">$t_start</span> <span class="o">=</span> <span class="p">[</span><span class="nn">Time::HiRes::</span><span class="n">gettimeofday</span><span class="p">];</span> </span><span id="L-4"><a name="L-4"></a><span class="k">my</span> <span class="nv">$t_end</span> <span class="o">=</span> <span class="p">[</span><span class="nn">Time::HiRes::</span><span class="n">gettimeofday</span><span class="p">];</span> </span><span id="L-5"><a name="L-5"></a><span class="k">print</span> <span class="nn">Time::HiRes::</span><span class="n">tv_interval</span> <span class="p">(</span><span class="nv">$t_start</span><span class="p">,</span> <span class="nv">$t_end</span><span class="p">)</span> <span class="o">.</span> <span class="s">&quot;\n&quot;</span><span class="p">;</span> </span></pre></div> </td></tr></table>
hires, perl, time

Text only

Turn on Safari 4 pie chart page load progress meter

defaults write com.apple.Safari DebugSafari4IncludeToolbarRedesign -bool FALSE
defaults write com.apple.Safari DebugSafari4LoadProgressStyle -bool TRUE
https://snipt.net/embed/378c0086643814806d6a9574c685cee4/
/raw/378c0086643814806d6a9574c685cee4/
378c0086643814806d6a9574c685cee4
text
Text only
2
2019-05-19T13:12:06
True
False
False
/api/public/snipt/3473/
turn-on-safari-4-pie-chart-progress-indicator
<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>defaults write com.apple.Safari DebugSafari4IncludeToolbarRedesign -bool FALSE </span><span id="L-2"><a name="L-2"></a>defaults write com.apple.Safari DebugSafari4LoadProgressStyle -bool TRUE </span></pre></div> </td></tr></table>
mac, preference, safari

SQL

Console logging in PL/SQL

dbms_output.put_line ('something');
https://snipt.net/embed/f3fc980b738b9e3e294d3f2cf17a6514/
/raw/f3fc980b738b9e3e294d3f2cf17a6514/
f3fc980b738b9e3e294d3f2cf17a6514
sql
SQL
1
2019-05-14T08:58:01
True
False
False
/api/public/snipt/3170/
console-logging-in-plsql
<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><span class="n">dbms_output</span><span class="p">.</span><span class="n">put_line</span> <span class="p">(</span><span class="s1">&#39;something&#39;</span><span class="p">);</span> </span></pre></div> </td></tr></table>
oracle, sql

Text only

Burn disc from command line (drutil also does more)

drutil burn myfile
https://snipt.net/embed/bd4e57718f4ca182e9dfef31ef31f9fe/
/raw/bd4e57718f4ca182e9dfef31ef31f9fe/
bd4e57718f4ca182e9dfef31ef31f9fe
text
Text only
1
2019-05-14T10:36:22
True
False
False
/api/public/snipt/3142/
burn-disc-from-command-line-drutil-also-does-more
<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>drutil burn myfile </span></pre></div> </td></tr></table>
mac

Text only

Access remote iTunes share

dns-sd -P "any name" _daap._tcp. local 3690 localhost 127.0.0.1 & 
ssh -N [email protected] -L 3690:localhost:3689
https://snipt.net/embed/2316123e4dcfdd92601af8b2271d3be5/
/raw/2316123e4dcfdd92601af8b2271d3be5/
2316123e4dcfdd92601af8b2271d3be5
text
Text only
2
2019-05-14T07:31:16
True
False
False
/api/public/snipt/3141/
access-remote-itunes-share
<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>dns-sd -P &quot;any name&quot; _daap._tcp. local 3690 localhost 127.0.0.1 &amp; </span><span id="L-2"><a name="L-2"></a>ssh -N [email protected] -L 3690:localhost:3689 </span></pre></div> </td></tr></table>
mac

Text only

Turn on file paths at top of Finder window

defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES 
https://snipt.net/embed/81a251e63795569ef97515575f9d62b1/
/raw/81a251e63795569ef97515575f9d62b1/
81a251e63795569ef97515575f9d62b1
text
Text only
1
2019-05-15T15:34:43
True
False
False
/api/public/snipt/3140/
turn-on-file-paths-at-top-of-finder-window
<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>defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES </span></pre></div> </td></tr></table>
mac, preference