snipt

Ctrl+h for KB shortcuts

HTML+PHP

WP List Blogroll

<?php get_links(-1, '<li>', '</li>', '', TRUE, 'url', FALSE); ?>
https://snipt.net/embed/93dac9b1fa79cdeb784bc952e8a1e63e/
/raw/93dac9b1fa79cdeb784bc952e8a1e63e/
93dac9b1fa79cdeb784bc952e8a1e63e
html+php
HTML+PHP
1
2019-07-05T11:56:46
True
False
False
/api/public/snipt/713/
wp-list-blogroll
<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="cp">&lt;?php</span> <span class="nx">get_links</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="s1">&#39;&lt;li&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;&lt;/li&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="k">TRUE</span><span class="p">,</span> <span class="s1">&#39;url&#39;</span><span class="p">,</span> <span class="k">FALSE</span><span class="p">);</span> <span class="cp">?&gt;</span> </span></pre></div> </td></tr></table>
list

MySQL

find duplicates mysql

1
2
3
4
5
SELECT name,
COUNT(name) AS NumOccurrences
FROM nt_projects
GROUP BY name
HAVING ( COUNT(name) > 1 )
https://snipt.net/embed/63ef7f626c15a01c2ca2f2781234e861/
/raw/63ef7f626c15a01c2ca2f2781234e861/
63ef7f626c15a01c2ca2f2781234e861
mysql
MySQL
5
2019-07-13T00:54:26
True
False
False
/api/public/snipt/706/
find-duplicates-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> <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">SELECT</span> <span class="n">name</span><span class="p">,</span> </span><span id="L-2"><a name="L-2"></a><span class="nf">COUNT</span><span class="p">(</span><span class="n">name</span><span class="p">)</span> <span class="k">AS</span> <span class="n">NumOccurrences</span> </span><span id="L-3"><a name="L-3"></a><span class="k">FROM</span> <span class="n">nt_projects</span> </span><span id="L-4"><a name="L-4"></a><span class="k">GROUP</span> <span class="k">BY</span> <span class="n">name</span> </span><span id="L-5"><a name="L-5"></a><span class="k">HAVING</span> <span class="p">(</span> <span class="nf">COUNT</span><span class="p">(</span><span class="n">name</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</span> <span class="p">)</span> </span></pre></div> </td></tr></table>
mysql

Text only

reload apache server

/etc/init.d/apache2 force-reload
https://snipt.net/embed/68e981180198e8e8eea412e9eea4f73a/
/raw/68e981180198e8e8eea412e9eea4f73a/
68e981180198e8e8eea412e9eea4f73a
text
Text only
2
2019-07-09T09:37:50
True
False
False
/api/public/snipt/700/
reload-apache-server
<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>/etc/init.d/apache2 force-reload </span></pre></div> </td></tr></table>
apache, terminal

Text only

google codes

http://code.google.com/intl/es-ES/chromium/
https://snipt.net/embed/88a7e09e4966d47bf2ad5f9c4221c231/
/raw/88a7e09e4966d47bf2ad5f9c4221c231/
88a7e09e4966d47bf2ad5f9c4221c231
text
Text only
1
2019-07-14T22:32:04
True
False
False
/api/public/snipt/697/
google-codes
<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>http://code.google.com/intl/es-ES/chromium/ </span></pre></div> </td></tr></table>
chrome, code, google

CSS

CSS Reset

1
2
3
4
5
6
* {
  padding: 0;
  margin: 0;
  text-decoration: none;
  outline: none;
}
https://snipt.net/embed/50f6aaafb60f6641692e6c3f0de7def4/
/raw/50f6aaafb60f6641692e6c3f0de7def4/
50f6aaafb60f6641692e6c3f0de7def4
css
CSS
6
2019-07-16T00:00:40
True
False
False
/api/public/snipt/691/
css-reset-2
<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="o">*</span> <span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="nb">padding</span><span class="o">:</span> <span class="m">0</span><span class="p">;</span> </span><span id="L-3"><a name="L-3"></a> <span class="nb">margin</span><span class="o">:</span> <span class="m">0</span><span class="p">;</span> </span><span id="L-4"><a name="L-4"></a> <span class="nb">text-decoration</span><span class="o">:</span> <span class="nb">none</span><span class="p">;</span> </span><span id="L-5"><a name="L-5"></a> <span class="nb">outline</span><span class="o">:</span> <span class="nb">none</span><span class="p">;</span> </span><span id="L-6"><a name="L-6"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
css, reset

Python

return a string starting w/the last occurrence of '/'

mystring = "http://some.domain/foo/bar/returnedstring"
mystring[-(mystring[::-1].find('/')):]
https://snipt.net/embed/06f35208aac725e4436748e89da6b996/
/raw/06f35208aac725e4436748e89da6b996/
06f35208aac725e4436748e89da6b996
python
Python
3
2019-07-11T23:00:53
True
False
False
/api/public/snipt/690/
return-a-string-starting-wthe-last-occurrence-of
<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="n">mystring</span> <span class="o">=</span> <span class="s2">&quot;http://some.domain/foo/bar/returnedstring&quot;</span> </span><span id="L-2"><a name="L-2"></a><span class="n">mystring</span><span class="p">[</span><span class="o">-</span><span class="p">(</span><span class="n">mystring</span><span class="p">[::</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">find</span><span class="p">(</span><span class="s1">&#39;/&#39;</span><span class="p">)):]</span> </span></pre></div> </td></tr></table>
python, string-manip

Bash

rename uppercase JPG to lowercase jpg

rename -v 's/\.JPG$/\.jpg/' *.JPG
https://snipt.net/embed/d1d60f16d47646faa5518f699f99c1f3/
/raw/d1d60f16d47646faa5518f699f99c1f3/
d1d60f16d47646faa5518f699f99c1f3
bash
Bash
1
2019-07-15T14:54:57
True
False
False
/api/public/snipt/682/
rename-uppercase-jpg-to-lowercase-jpg
<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>rename -v <span class="s1">&#39;s/\.JPG$/\.jpg/&#39;</span> *.JPG </span></pre></div> </td></tr></table>
rename, shell