snipt

Ctrl+h for KB shortcuts

Text only

Existing files to git

1
2
3
4
5
git init
git add .
git commit
git remote add origin https://jbmckee@bitbucket.org/jbmckee/snaprsend.git
git push -u origin master
https://snipt.net/embed/a08e51b4dff275fc1d931fd7584c3799/
/raw/a08e51b4dff275fc1d931fd7584c3799/
a08e51b4dff275fc1d931fd7584c3799
text
Text only
6
2024-05-03T02:03:08
True
False
False
May 16, 2018 at 02:12 AM
/api/public/snipt/60/
existing-files-to-git
<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>git init </span><span id="L-2"><a name="L-2"></a>git add . </span><span id="L-3"><a name="L-3"></a>git commit </span><span id="L-4"><a name="L-4"></a>git remote add origin https://jbmckee@bitbucket.org/jbmckee/snaprsend.git </span><span id="L-5"><a name="L-5"></a>git push -u origin master </span></pre></div> </td></tr></table>
git

Text only

LetsEncrypt

sudo certbot --apache
https://snipt.net/embed/0d58fd847cc5f75beda4be8bece3798c/
/raw/0d58fd847cc5f75beda4be8bece3798c/
0d58fd847cc5f75beda4be8bece3798c
text
Text only
1
2024-05-07T14:36:01
True
False
False
May 11, 2018 at 08:36 PM
/api/public/snipt/59/
letsencrypt
<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>sudo certbot --apache </span></pre></div> </td></tr></table>

Text only

Redirect ssl

1
2
3
4
5
RewriteEngine on
RewriteRule ^ https://www.shrinkfortheshyguy.com%{REQUEST_URI} [END,NE,R=permanent]


Redirect permanent / https://agents.reviewmagnetsystem.com/
https://snipt.net/embed/3dd47f232da56c0971d811bd0ace1934/
/raw/3dd47f232da56c0971d811bd0ace1934/
3dd47f232da56c0971d811bd0ace1934
text
Text only
5
2024-05-02T14:31:09
True
False
False
/api/public/snipt/58/
redirect-ssl
<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>RewriteRule ^ https://www.shrinkfortheshyguy.com%{REQUEST_URI} [END,NE,R=permanent] </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a>Redirect permanent / https://agents.reviewmagnetsystem.com/ </span></pre></div> </td></tr></table>
Letsencrypt, apache, linux

Text only

show processlist

show processlist
https://snipt.net/embed/1e7b2d4d9b3c6b3a9a480acc5cf1af28/
/raw/1e7b2d4d9b3c6b3a9a480acc5cf1af28/
1e7b2d4d9b3c6b3a9a480acc5cf1af28
text
Text only
1
2024-05-02T04:19:21
True
False
False
May 09, 2018 at 02:01 PM
/api/public/snipt/57/
show-processlist
<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>show processlist </span></pre></div> </td></tr></table>

Text only

Sum of not null values

select count(*) as totalsent, sum(opened is not null) as opened, round((sum(opened is not null)/count(*))*100) openperc, sum(clicked is not null) as clicked, round((sum(clicked is not null)/sum(opened is not null))*100) clickperc
https://snipt.net/embed/3ec2b73c60eba7468418c6d08ad753ee/
/raw/3ec2b73c60eba7468418c6d08ad753ee/
3ec2b73c60eba7468418c6d08ad753ee
text
Text only
2
2024-05-02T15:32:51
True
False
False
Apr 20, 2018 at 01:19 PM
/api/public/snipt/56/
sum-of-not-null-values
<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>select count(*) as totalsent, sum(opened is not null) as opened, round((sum(opened is not null)/count(*))*100) openperc, sum(clicked is not null) as clicked, round((sum(clicked is not null)/sum(opened is not null))*100) clickperc </span></pre></div> </td></tr></table>
mysql, mysqli, sql

Text only

RBAC

1
2
3
4
5
'authManager' => [
	'class' => 'yii\rbac\DbManager',
],

yii migrate --migrationPath=@yii/rbac/migrations/
https://snipt.net/embed/c9f9e8d76f8751c931d4d25d2cbc8537/
/raw/c9f9e8d76f8751c931d4d25d2cbc8537/
c9f9e8d76f8751c931d4d25d2cbc8537
text
Text only
5
2024-05-07T23:30:05
True
False
False
Feb 03, 2018 at 05:15 PM
/api/public/snipt/21/
rbac
<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>&#39;authManager&#39; =&gt; [ </span><span id="L-2"><a name="L-2"></a> &#39;class&#39; =&gt; &#39;yii\rbac\DbManager&#39;, </span><span id="L-3"><a name="L-3"></a>], </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a>yii migrate --migrationPath=@yii/rbac/migrations/ </span></pre></div> </td></tr></table>
yii

Text only

Laravel Get user id

$id = \Auth::user()->id;
https://snipt.net/embed/5d318b260db9f79e2849dd66843c1361/
/raw/5d318b260db9f79e2849dd66843c1361/
5d318b260db9f79e2849dd66843c1361
text
Text only
1
2024-05-08T19:13:38
True
False
False
Dec 19, 2017 at 03:11 AM
/api/public/snipt/19/
laravel-get-user-id
<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>$id = \Auth::user()-&gt;id; </span></pre></div> </td></tr></table>
laravel