snipt

Ctrl+h for KB shortcuts

Bash

apply svn patch

patch -p0 -i ~/fix_ugly_bug.diff
https://snipt.net/embed/255eb29493f16ac032fed2cb1c01ad2f/
/raw/255eb29493f16ac032fed2cb1c01ad2f/
255eb29493f16ac032fed2cb1c01ad2f
bash
Bash
1
2019-02-20T06:17:20
True
False
False
/api/public/snipt/596/
apply-svn-patch
<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>patch -p0 -i ~/fix_ugly_bug.diff </span></pre></div> </td></tr></table>
subversion

MySQL

update mysql table data

UPDATE snippet_snippet SET public=0;
https://snipt.net/embed/5b6fcb789a01a5c7e79c5a4120258496/
/raw/5b6fcb789a01a5c7e79c5a4120258496/
5b6fcb789a01a5c7e79c5a4120258496
mysql
MySQL
1
2019-06-04T02:23:47
True
False
False
/api/public/snipt/321/
update-mysql-table-data
<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="k">UPDATE</span> <span class="n">snippet_snippet</span> <span class="kt">SET</span> <span class="n">public</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> </span></pre></div> </td></tr></table>
mysql

MySQL

add column to mysql table

ALTER TABLE snippet_snippet ADD public TINYINT(1) NOT NULL;
https://snipt.net/embed/d3c7ae0ac7b65be9d4dc1eb8a4efd845/
/raw/d3c7ae0ac7b65be9d4dc1eb8a4efd845/
d3c7ae0ac7b65be9d4dc1eb8a4efd845
mysql
MySQL
1
2019-05-30T23:58:19
True
False
False
/api/public/snipt/319/
add-column-to-mysql-table
<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="k">ALTER</span> <span class="k">TABLE</span> <span class="n">snippet_snippet</span> <span class="k">ADD</span> <span class="n">public</span> <span class="kt">TINYINT</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="k">NOT</span> <span class="no">NULL</span><span class="p">;</span> </span></pre></div> </td></tr></table>
mysql

Bash

svn delete all files marked for deletion

svn status |grep '^!' |sed 's/^!      /svn delete "/g' |sed 's/$/"/g' |sh
https://snipt.net/embed/13be4cf6c9164f255653122f1f9bad8d/
/raw/13be4cf6c9164f255653122f1f9bad8d/
13be4cf6c9164f255653122f1f9bad8d
bash
Bash
1
2019-06-23T00:12:22
True
False
False
/api/public/snipt/69/
svn-delete-all-files-marked-for-deletion
<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>svn status <span class="p">|</span>grep <span class="s1">&#39;^!&#39;</span> <span class="p">|</span>sed <span class="s1">&#39;s/^! /svn delete &quot;/g&#39;</span> <span class="p">|</span>sed <span class="s1">&#39;s/$/&quot;/g&#39;</span> <span class="p">|</span>sh </span></pre></div> </td></tr></table>
subversion

Bash

svn add all files marked for add

svn status |grep '^?' |sed 's/^?      /svn add "/g' |sed 's/$/"/g' |sh
https://snipt.net/embed/d08a99d87660f35353d5fb6cd0f1b15b/
/raw/d08a99d87660f35353d5fb6cd0f1b15b/
d08a99d87660f35353d5fb6cd0f1b15b
bash
Bash
1
2019-06-23T05:31:26
True
False
False
/api/public/snipt/68/
svn-add-all-files-marked-for-add
<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>svn status <span class="p">|</span>grep <span class="s1">&#39;^?&#39;</span> <span class="p">|</span>sed <span class="s1">&#39;s/^? /svn add &quot;/g&#39;</span> <span class="p">|</span>sed <span class="s1">&#39;s/$/&quot;/g&#39;</span> <span class="p">|</span>sh </span></pre></div> </td></tr></table>
subversion

Bash

recursively remove all .svn directories

find . -name .svn -print0 | xargs -0 rm -rf
https://snipt.net/embed/c1a0386cbfe673d8aecaf85d012372c2/
/raw/c1a0386cbfe673d8aecaf85d012372c2/
c1a0386cbfe673d8aecaf85d012372c2
bash
Bash
1
2019-06-13T06:55:05
True
False
False
/api/public/snipt/67/
recursively-remove-all-svn-directories
<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>find . -name .svn -print0 <span class="p">|</span> xargs -0 rm -rf </span></pre></div> </td></tr></table>
subversion

JavaScript

grab selected option from select element

$('#selectList').val();
https://snipt.net/embed/ab9f23364ec4895ead234c065ad7466f/
/raw/ab9f23364ec4895ead234c065ad7466f/
ab9f23364ec4895ead234c065ad7466f
js
JavaScript
1
2019-06-13T06:56:12
True
False
False
/api/public/snipt/46/
grab-selected-option-from-select-element
<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="nx">$</span><span class="p">(</span><span class="s1">&#39;#selectList&#39;</span><span class="p">).</span><span class="nx">val</span><span class="p">();</span> </span></pre></div> </td></tr></table>
javascript, jquery

Bash

add existing user to primary group

usermod -a -G ftp tony
https://snipt.net/embed/7af5ed24e4ea83713e0524eed086e631/
/raw/7af5ed24e4ea83713e0524eed086e631/
7af5ed24e4ea83713e0524eed086e631
bash
Bash
1
2019-06-18T15:26:30
True
False
False
/api/public/snipt/42/
add-existing-user-to-primary-group
<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>usermod -a -G ftp tony </span></pre></div> </td></tr></table>
unix

HTML

ie6 conditional

<!--[if IE 6]><![endif]-->
https://snipt.net/embed/a04ce83e4441d1d1af0b6dcbd6cf27a4/
/raw/a04ce83e4441d1d1af0b6dcbd6cf27a4/
a04ce83e4441d1d1af0b6dcbd6cf27a4
html
HTML
1
2019-06-13T06:57:04
True
False
False
/api/public/snipt/40/
ie6-conditional
<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="c">&lt;!--[if IE 6]&gt;&lt;![endif]--&gt;</span> </span></pre></div> </td></tr></table>
ie