snipt

Ctrl+h for KB shortcuts

Bash

Adicionar un path a mi usuario

export PATH=$PATH:/var/www/html/cake/cake/console
https://snipt.net/embed/e7c1002e5e9cd883543425dd9561c876/
/raw/e7c1002e5e9cd883543425dd9561c876/
e7c1002e5e9cd883543425dd9561c876
bash
Bash
2
2019-06-14T20:21:14
True
False
False
/api/public/snipt/446/
adicionar-un-path-a-mi-usuario
<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="nb">export</span> <span class="nv">PATH</span><span class="o">=</span><span class="nv">$PATH</span>:/var/www/html/cake/cake/console </span></pre></div> </td></tr></table>
path

PHP

Prettyize Money

1
2
3
4
5
6
<?php

  setlocale(LC_MONETARY, 'en_US');
$total_formatted = money_format('%(#10n', $total) . "\n";

?>
https://snipt.net/embed/83bc0d90acbfa9c0297b56b4a5833114/
/raw/83bc0d90acbfa9c0297b56b4a5833114/
83bc0d90acbfa9c0297b56b4a5833114
php
PHP
6
2019-06-12T23:07:37
True
False
False
/api/public/snipt/444/
prettyize-money
<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> <a href="#L-6">6</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><span id="L-3"><a name="L-3"></a> <span class="nb">setlocale</span><span class="p">(</span><span class="nx">LC_MONETARY</span><span class="p">,</span> <span class="s1">&#39;en_US&#39;</span><span class="p">);</span> </span><span id="L-4"><a name="L-4"></a><span class="nv">$total_formatted</span> <span class="o">=</span> <span class="nb">money_format</span><span class="p">(</span><span class="s1">&#39;%(#10n&#39;</span><span class="p">,</span> <span class="nv">$total</span><span class="p">)</span> <span class="o">.</span> <span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">;</span> </span><span id="L-5"><a name="L-5"></a> </span><span id="L-6"><a name="L-6"></a><span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
money, php

ApacheConf

mod_rewrite 301 redirect

RewriteRule ^whatever/(.*)$ http://www.domain.com/$1/ [R=301,L]
https://snipt.net/embed/e4754a4e77c65133b1c9404bb821e45a/
/raw/e4754a4e77c65133b1c9404bb821e45a/
e4754a4e77c65133b1c9404bb821e45a
apacheconf
ApacheConf
1
2019-06-12T21:19:55
True
False
False
/api/public/snipt/438/
mod_rewrite-301-redirect
<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="nb">RewriteRule</span> ^whatever/(.*)$ http://www.domain.com/$1/ [R=301,L] </span></pre></div> </td></tr></table>
apache, mod_rewrite

INI

passwordless access to mysql

1
2
3
4
#this should be in your ~/.my.cnf
[client]
user=root
password=<the password>
https://snipt.net/embed/138070396e31c714ba371c70285d5dda/
/raw/138070396e31c714ba371c70285d5dda/
138070396e31c714ba371c70285d5dda
ini
INI
4
2019-06-07T11:55:13
True
False
False
/api/public/snipt/422/
passwordless-access-to-mysql
<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="c1">#this should be in your ~/.my.cnf</span> </span><span id="L-2"><a name="L-2"></a><span class="k">[client]</span> </span><span id="L-3"><a name="L-3"></a><span class="na">user</span><span class="o">=</span><span class="s">root</span> </span><span id="L-4"><a name="L-4"></a><span class="na">password</span><span class="o">=</span><span class="s">&lt;the password&gt;</span> </span></pre></div> </td></tr></table>
configuration, mysql, passwordless