snipt

Ctrl+h for KB shortcuts

Batchfile

batchfile to remove .svn dirs in all subdirs

FOR /F "tokens=*" %%G IN ('DIR /B /AD /S *.svn*') DO RMDIR /S /Q "%%G"
https://snipt.net/embed/4488a37ce158d21987bbe702af1ee97e/
/raw/4488a37ce158d21987bbe702af1ee97e/
4488a37ce158d21987bbe702af1ee97e
bat
Batchfile
1
2019-07-05T04:27:57
True
False
False
/api/public/snipt/3722/
batchfile-to-remove-svn-dirs-in-all-subdirs
<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> <span class="k">/F</span> <span class="s2">&quot;tokens=*&quot;</span> <span class="se">%%</span>G <span class="k">IN</span> <span class="p">(</span><span class="s1">&#39;DIR /B /AD /S *.svn*&#39;</span><span class="p">)</span> <span class="k">DO</span> <span class="k">RMDIR</span> /S /Q <span class="s2">&quot;</span><span class="se">%%</span><span class="s2">G&quot;</span> </span></pre></div> </td></tr></table>
batch, batchfile, dir, svn

C#

general linq query to look up string in a list of arrays

1
2
3
var query = from row in data
            where row[0].Contains(searchObject.ToString())
            select row;
https://snipt.net/embed/34b905410c08c7a6277900820e058926/
/raw/34b905410c08c7a6277900820e058926/
34b905410c08c7a6277900820e058926
csharp
C#
3
2019-07-12T10:44:26
True
False
False
/api/public/snipt/3326/
general-linq-query-to-look-up-string-in-a-list-of-arrays
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="kt">var</span> <span class="n">query</span> <span class="p">=</span> <span class="k">from</span> <span class="n">row</span> <span class="k">in</span> <span class="n">data</span> </span><span id="L-2"><a name="L-2"></a> <span class="k">where</span> <span class="n">row</span><span class="p">[</span><span class="m">0</span><span class="p">].</span><span class="n">Contains</span><span class="p">(</span><span class="n">searchObject</span><span class="p">.</span><span class="n">ToString</span><span class="p">())</span> </span><span id="L-3"><a name="L-3"></a> <span class="k">select</span> <span class="n">row</span><span class="p">;</span> </span></pre></div> </td></tr></table>
c#, linq

MySQL

mysql dump results to csv

1
2
3
4
5
6
select my_columns 
into outfile '/tmp/results.csv'
fields terminated by ',' optionally enclosed by '"'
escaped by '\\'
lines terminated by '\n'
from my_table;
https://snipt.net/embed/f737d5523136f89ce329ce2eb3b4b293/
/raw/f737d5523136f89ce329ce2eb3b4b293/
f737d5523136f89ce329ce2eb3b4b293
mysql
MySQL
6
2019-07-19T21:13:36
True
False
False
/api/public/snipt/3279/
mysql-dump-results-to-csv
<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="k">select</span> <span class="n">my_columns</span> </span><span id="L-2"><a name="L-2"></a><span class="k">into</span> <span class="k">outfile</span> <span class="s1">&#39;/tmp/results.csv&#39;</span> </span><span id="L-3"><a name="L-3"></a><span class="n">fields</span> <span class="k">terminated</span> <span class="k">by</span> <span class="s1">&#39;,&#39;</span> <span class="k">optionally</span> <span class="k">enclosed</span> <span class="k">by</span> <span class="s1">&#39;&quot;&#39;</span> </span><span id="L-4"><a name="L-4"></a><span class="k">escaped</span> <span class="k">by</span> <span class="s1">&#39;\\&#39;</span> </span><span id="L-5"><a name="L-5"></a><span class="k">lines</span> <span class="k">terminated</span> <span class="k">by</span> <span class="s1">&#39;\n&#39;</span> </span><span id="L-6"><a name="L-6"></a><span class="k">from</span> <span class="n">my_table</span><span class="p">;</span> </span></pre></div> </td></tr></table>
csv, mysql