snipt

Ctrl+h for KB shortcuts

CSS

Main @media

1
2
3
4
@media (min-width: 1200px) {}
@media (max-width: 767px) {}
@media (min-width: 768px) and (max-width: 979px) {}
@media (max-width: 480px) {}
https://snipt.net/embed/c4cf8d19289a9ed5e29272aa8d3e727a/
/raw/c4cf8d19289a9ed5e29272aa8d3e727a/
c4cf8d19289a9ed5e29272aa8d3e727a
css
CSS
4
2019-06-13T15:45:23
True
False
False
Jul 09, 2012 at 09:50 AM
/api/public/snipt/43644/
main-media
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">@media</span> <span class="o">(</span><span class="nt">min-width</span><span class="o">:</span> <span class="nt">1200px</span><span class="o">)</span> <span class="p">{}</span> </span><span id="L-2"><a name="L-2"></a><span class="k">@media</span> <span class="o">(</span><span class="nt">max-width</span><span class="o">:</span> <span class="nt">767px</span><span class="o">)</span> <span class="p">{}</span> </span><span id="L-3"><a name="L-3"></a><span class="k">@media</span> <span class="o">(</span><span class="nt">min-width</span><span class="o">:</span> <span class="nt">768px</span><span class="o">)</span> <span class="nt">and</span> <span class="o">(</span><span class="nt">max-width</span><span class="o">:</span> <span class="nt">979px</span><span class="o">)</span> <span class="p">{}</span> </span><span id="L-4"><a name="L-4"></a><span class="k">@media</span> <span class="o">(</span><span class="nt">max-width</span><span class="o">:</span> <span class="nt">480px</span><span class="o">)</span> <span class="p">{}</span> </span></pre></div> </td></tr></table>
css, media, responsive, screen

CSS

CSS selected text color

1
2
3
4
5
6
::selection {
    background: #ffb7b7; /* Safari */
	}
::-moz-selection {
	background: #ffb7b7; /* Firefox */
}
https://snipt.net/embed/0dbe7e2526fd3c28e52954d453852b55/
/raw/0dbe7e2526fd3c28e52954d453852b55/
0dbe7e2526fd3c28e52954d453852b55
css
CSS
6
2019-06-09T05:54:16
True
False
False
/api/public/snipt/42141/
css-selected-text-color
<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="nd">:selection</span> <span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="nb">background</span><span class="o">:</span> <span class="m">#ffb7b7</span><span class="p">;</span> <span class="c">/* Safari */</span> </span><span id="L-3"><a name="L-3"></a> <span class="p">}</span> </span><span id="L-4"><a name="L-4"></a><span class="o">:</span><span class="nd">:-moz-selection</span> <span class="p">{</span> </span><span id="L-5"><a name="L-5"></a> <span class="nb">background</span><span class="o">:</span> <span class="m">#ffb7b7</span><span class="p">;</span> <span class="c">/* Firefox */</span> </span><span id="L-6"><a name="L-6"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
css

MySQL

Search last updated table / last changes on a database

1
2
3
4
SELECT UPDATE_TIME
FROM   information_schema.tables
WHERE  TABLE_SCHEMA = 'dbname'
   AND TABLE_NAME = 'tabname'
https://snipt.net/embed/2dbf1832aa04e16de517212bdc94ccf8/
/raw/2dbf1832aa04e16de517212bdc94ccf8/
2dbf1832aa04e16de517212bdc94ccf8
mysql
MySQL
4
2019-06-17T07:33:10
True
False
False
/api/public/snipt/42060/
search-last-updated-table-last-changes-on-a-database
<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></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">UPDATE_TIME</span> </span><span id="L-2"><a name="L-2"></a><span class="k">FROM</span> <span class="n">information_schema</span><span class="p">.</span><span class="kp">tables</span> </span><span id="L-3"><a name="L-3"></a><span class="k">WHERE</span> <span class="n">TABLE_SCHEMA</span> <span class="o">=</span> <span class="s1">&#39;dbname&#39;</span> </span><span id="L-4"><a name="L-4"></a> <span class="k">AND</span> <span class="n">TABLE_NAME</span> <span class="o">=</span> <span class="s1">&#39;tabname&#39;</span> </span></pre></div> </td></tr></table>

SQL

Wordpress DB Migrate

1
2
3
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsite.com', 'http://www.newsite.com') WHERE option_name = 'home' OR option_name = 'siteurl'; 
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldsite.com','http://www.newsite.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldsite.com', 'http://www.newsite.com'); 
https://snipt.net/embed/f2bdc413ebd09705d8da8e800c02eb04/
/raw/f2bdc413ebd09705d8da8e800c02eb04/
f2bdc413ebd09705d8da8e800c02eb04
sql
SQL
3
2019-06-16T22:46:13
True
False
False
/api/public/snipt/40777/
wordpress-db-migrate-1
<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="k">UPDATE</span> <span class="n">wp_options</span> <span class="k">SET</span> <span class="n">option_value</span> <span class="o">=</span> <span class="k">replace</span><span class="p">(</span><span class="n">option_value</span><span class="p">,</span> <span class="s1">&#39;http://www.oldsite.com&#39;</span><span class="p">,</span> <span class="s1">&#39;http://www.newsite.com&#39;</span><span class="p">)</span> <span class="k">WHERE</span> <span class="n">option_name</span> <span class="o">=</span> <span class="s1">&#39;home&#39;</span> <span class="k">OR</span> <span class="n">option_name</span> <span class="o">=</span> <span class="s1">&#39;siteurl&#39;</span><span class="p">;</span> </span><span id="L-2"><a name="L-2"></a><span class="k">UPDATE</span> <span class="n">wp_posts</span> <span class="k">SET</span> <span class="n">guid</span> <span class="o">=</span> <span class="k">replace</span><span class="p">(</span><span class="n">guid</span><span class="p">,</span> <span class="s1">&#39;http://www.oldsite.com&#39;</span><span class="p">,</span><span class="s1">&#39;http://www.newsite.com&#39;</span><span class="p">);</span> </span><span id="L-3"><a name="L-3"></a><span class="k">UPDATE</span> <span class="n">wp_posts</span> <span class="k">SET</span> <span class="n">post_content</span> <span class="o">=</span> <span class="k">replace</span><span class="p">(</span><span class="n">post_content</span><span class="p">,</span> <span class="s1">&#39;http://www.oldsite.com&#39;</span><span class="p">,</span> <span class="s1">&#39;http://www.newsite.com&#39;</span><span class="p">);</span> </span></pre></div> </td></tr></table>
Wordpress, database, migration