snipt

Ctrl+h for KB shortcuts

Text only

crop mp3 using ffmpeg

ffmpeg -i source.mp3 -acodec copy -t 00:03:15 -ss 00:00:00 target.mp3 
https://snipt.net/embed/7c3572cc1dcd52b2162125c3cd1ab671/
/raw/7c3572cc1dcd52b2162125c3cd1ab671/
7c3572cc1dcd52b2162125c3cd1ab671
text
Text only
1
2019-08-23T01:27:55
True
False
False
Jan 26, 2013 at 01:09 AM
/api/public/snipt/54529/
crop-mp3-using-ffmpeg
<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>ffmpeg -i source.mp3 -acodec copy -t 00:03:15 -ss 00:00:00 target.mp3 </span></pre></div> </td></tr></table>
bash, ffmpeg, mp3

Text only

Ejecutar un PHP en vez de un JS

1
2
3
4
5
RewriteEngine on

RewriteCond %{REQUEST_URI} ^/magic.js
RewriteCond %{QUERY_STRING} ((.*))?
RewriteRule (.*)  magic.php?%2 [L]
https://snipt.net/embed/47146a4e3fbda964500551cfd323c087/
/raw/47146a4e3fbda964500551cfd323c087/
47146a4e3fbda964500551cfd323c087
text
Text only
5
2019-08-22T22:54:49
True
False
False
/api/public/snipt/52883/
ejecutar-un-php-en-vez-de-un-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>RewriteEngine on </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>RewriteCond %{REQUEST_URI} ^/magic.js </span><span id="L-4"><a name="L-4"></a>RewriteCond %{QUERY_STRING} ((.*))? </span><span id="L-5"><a name="L-5"></a>RewriteRule (.*) magic.php?%2 [L] </span></pre></div> </td></tr></table>
apache, htaccess, js, php, vhost

PHP

reemplaza los \n y \r con tags <br />

1
2
3
4
<?php
    function nl2br($text) { 
        return strtr($text, array("\r\n" => '<br />', "\r" => '<br />', "\n" => '<br />')); 
    } 
https://snipt.net/embed/d64a5d2028d83cea00afdfebf78cf3d1/
/raw/d64a5d2028d83cea00afdfebf78cf3d1/
d64a5d2028d83cea00afdfebf78cf3d1
php
PHP
4
2019-08-23T15:25:37
True
False
False
Sep 19, 2012 at 12:01 PM
/api/public/snipt/30553/
reemplaza-los-n-y-r-con-tags-br
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a> <span class="k">function</span> <span class="nf">nl2br</span><span class="p">(</span><span class="nv">$text</span><span class="p">)</span> <span class="p">{</span> </span><span id="L-3"><a name="L-3"></a> <span class="k">return</span> <span class="nb">strtr</span><span class="p">(</span><span class="nv">$text</span><span class="p">,</span> <span class="k">array</span><span class="p">(</span><span class="s2">&quot;</span><span class="se">\r\n</span><span class="s2">&quot;</span> <span class="o">=&gt;</span> <span class="s1">&#39;&lt;br /&gt;&#39;</span><span class="p">,</span> <span class="s2">&quot;</span><span class="se">\r</span><span class="s2">&quot;</span> <span class="o">=&gt;</span> <span class="s1">&#39;&lt;br /&gt;&#39;</span><span class="p">,</span> <span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span> <span class="o">=&gt;</span> <span class="s1">&#39;&lt;br /&gt;&#39;</span><span class="p">));</span> </span><span id="L-4"><a name="L-4"></a> <span class="p">}</span> </span></pre></div> </td></tr></table>
php