snipt

Ctrl+h for KB shortcuts

Text only

SVN: Revert commit

svn merge -r [current_version]:[previous_version] [repository_url]
https://snipt.net/embed/b5a1deeec737e0c9996d606b5aa6f45a/
/raw/b5a1deeec737e0c9996d606b5aa6f45a/
b5a1deeec737e0c9996d606b5aa6f45a
text
Text only
1
2019-07-17T21:12:30
True
False
False
Aug 27, 2012 at 06:39 AM
/api/public/snipt/46333/
svn-revert-commit
<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 merge -r [current_version]:[previous_version] [repository_url] </span></pre></div> </td></tr></table>
svn

Bash

Cat into clipboard

cat document.txt | pbcopy
https://snipt.net/embed/897c4688a2e34a980372b2efc47ac835/
/raw/897c4688a2e34a980372b2efc47ac835/
897c4688a2e34a980372b2efc47ac835
bash
Bash
1
2019-07-03T12:36:25
True
False
False
Jul 14, 2012 at 03:30 PM
/api/public/snipt/43914/
cat-into-clipboard
<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>cat document.txt <span class="p">|</span> pbcopy </span></pre></div> </td></tr></table>

SQL

Mysql replace text

1
2
3
4
5
update product 
set 
image = replace(image, '.png', '.jpg'), 
image_zoom = replace(image_zoom, '.png', '.jpg'), 
image_look = replace(image_look, '.png', '.jpg')
https://snipt.net/embed/48307d2b892f8a1ce5ff65f2eb45d897/
/raw/48307d2b892f8a1ce5ff65f2eb45d897/
48307d2b892f8a1ce5ff65f2eb45d897
sql
SQL
5
2019-07-17T17:06:58
True
False
False
/api/public/snipt/24510/
mysql-replace-text
<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">update</span> <span class="n">product</span> </span><span id="L-2"><a name="L-2"></a><span class="k">set</span> </span><span id="L-3"><a name="L-3"></a><span class="n">image</span> <span class="o">=</span> <span class="k">replace</span><span class="p">(</span><span class="n">image</span><span class="p">,</span> <span class="s1">&#39;.png&#39;</span><span class="p">,</span> <span class="s1">&#39;.jpg&#39;</span><span class="p">),</span> </span><span id="L-4"><a name="L-4"></a><span class="n">image_zoom</span> <span class="o">=</span> <span class="k">replace</span><span class="p">(</span><span class="n">image_zoom</span><span class="p">,</span> <span class="s1">&#39;.png&#39;</span><span class="p">,</span> <span class="s1">&#39;.jpg&#39;</span><span class="p">),</span> </span><span id="L-5"><a name="L-5"></a><span class="n">image_look</span> <span class="o">=</span> <span class="k">replace</span><span class="p">(</span><span class="n">image_look</span><span class="p">,</span> <span class="s1">&#39;.png&#39;</span><span class="p">,</span> <span class="s1">&#39;.jpg&#39;</span><span class="p">)</span> </span></pre></div> </td></tr></table>
find, mysql, replace

VimL

HowTo find and replace in VIM

 :%s/search/replace/g 
https://snipt.net/embed/515c239e8a998ce799018c6a18226a29/
/raw/515c239e8a998ce799018c6a18226a29/
515c239e8a998ce799018c6a18226a29
vim
VimL
1
2019-07-13T09:53:58
True
False
False
/api/public/snipt/19244/
howto-find-and-replace-in-vim
<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> :%s<span class="sr">/search/</span>replace/<span class="k">g</span> </span></pre></div> </td></tr></table>
"find replace", vim

VimL

convert camelCase to underscore in vi

"converte il camelCase in _ nelle righe dalla 1 alla 3
:1,3s/[A-Z]/_\L&/g 
https://snipt.net/embed/e4aa90620e21be386971c4b70bf194cb/
/raw/e4aa90620e21be386971c4b70bf194cb/
e4aa90620e21be386971c4b70bf194cb
vim
VimL
2
2019-07-15T18:19:43
True
False
False
/api/public/snipt/18367/
convert-camelcase-to-unsercore-in-vi
<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><span class="c">&quot;converte il camelCase in _ nelle righe dalla 1 alla 3</span> </span><span id="L-2"><a name="L-2"></a><span class="p">:</span><span class="m">1</span><span class="p">,</span><span class="m">3</span>s<span class="sr">/[A-Z]/</span>_\L&amp;/<span class="k">g</span> </span></pre></div> </td></tr></table>
camelcase, unserscore, vi, vim

Bash

create ram disk on osx 10.5 or greater

diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://1165430`
https://snipt.net/embed/e16938b5501567d21da0211e7f01544e/
/raw/e16938b5501567d21da0211e7f01544e/
e16938b5501567d21da0211e7f01544e
bash
Bash
1
2019-07-16T18:38:04
True
False
False
/api/public/snipt/18315/
create-ram-disk-on-osx-105-or-greater
<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>diskutil erasevolume HFS+ <span class="s2">&quot;ramdisk&quot;</span> <span class="sb">`</span>hdiutil attach -nomount ram://1165430<span class="sb">`</span> </span></pre></div> </td></tr></table>
ramdisk

Bash

Recursive revert all external items on svn WC

for i in $(svn status | grep ^Perf | cut -d\' -f 2); do svn revert -R $i ; done
https://snipt.net/embed/29a9c8adb6033617550ff4ba5da6bfcb/
/raw/29a9c8adb6033617550ff4ba5da6bfcb/
29a9c8adb6033617550ff4ba5da6bfcb
bash
Bash
1
2019-07-14T21:40:54
True
False
False
/api/public/snipt/15566/
recursive-revert-all-external-items-on-svn-wc
<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">for</span> i in <span class="k">$(</span>svn status <span class="p">|</span> grep ^Perf <span class="p">|</span> cut -d<span class="se">\&#39;</span> -f 2<span class="k">)</span><span class="p">;</span> <span class="k">do</span> svn revert -R <span class="nv">$i</span> <span class="p">;</span> <span class="k">done</span> </span></pre></div> </td></tr></table>
recursive, revert, svn, wc