snipt

Ctrl+h for KB shortcuts

CSS

Zebra rows table

#nomeTabella tr:nth-child(even) {background: #eee}
https://snipt.net/embed/0fa1174f735552b48010d7d2a92e0210/
/raw/0fa1174f735552b48010d7d2a92e0210/
0fa1174f735552b48010d7d2a92e0210
css
CSS
1
2016-12-25T10:50:23
True
False
True
Nov 16, 2012 at 06:35 AM
/api/public/snipt/41962/
righe-tabella-alternate-a-zebra
<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="nn">#nomeTabella</span> <span class="nt">tr</span><span class="nd">:nth-child</span><span class="o">(</span><span class="nt">even</span><span class="o">)</span> <span class="p">{</span><span class="nb">background</span><span class="o">:</span> <span class="m">#eee</span><span class="p">}</span> </span></pre></div> </td></tr></table>
css

PHP

Inizializzare un array con un dato range e mescolarlo

1
2
3
4
5
6
7
            <?php
$bannerArray = range(1,8);
shuffle($bannerArray);
foreach ($bannerArray as $numBanner) {
    echo '<img id="banner-img" src="../img/slideshow/'.$numBanner.'.jpg">'; echo "\n";
}
?>
https://snipt.net/embed/988c6162a28f1b43d78a07eebf239d9e/
/raw/988c6162a28f1b43d78a07eebf239d9e/
988c6162a28f1b43d78a07eebf239d9e
php
PHP
7
2019-07-31T06:26:34
True
False
False
/api/public/snipt/41732/
inizializzare-un-array-con-un-dato-range-e-mescolarlo
<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> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="x"> </span><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a><span class="nv">$bannerArray</span> <span class="o">=</span> <span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="mi">8</span><span class="p">);</span> </span><span id="L-3"><a name="L-3"></a><span class="nb">shuffle</span><span class="p">(</span><span class="nv">$bannerArray</span><span class="p">);</span> </span><span id="L-4"><a name="L-4"></a><span class="k">foreach</span> <span class="p">(</span><span class="nv">$bannerArray</span> <span class="k">as</span> <span class="nv">$numBanner</span><span class="p">)</span> <span class="p">{</span> </span><span id="L-5"><a name="L-5"></a> <span class="k">echo</span> <span class="s1">&#39;&lt;img id=&quot;banner-img&quot; src=&quot;../img/slideshow/&#39;</span><span class="o">.</span><span class="nv">$numBanner</span><span class="o">.</span><span class="s1">&#39;.jpg&quot;&gt;&#39;</span><span class="p">;</span> <span class="k">echo</span> <span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">;</span> </span><span id="L-6"><a name="L-6"></a><span class="p">}</span> </span><span id="L-7"><a name="L-7"></a><span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
array, shuffle

Bash

How to prevent SSH sessions to die for timeout

1
2
3
Add this in /etc/ssh_config

ServerAliveInterval 60
https://snipt.net/embed/e4eb3f3ad970026754d8f3e83e926dc1/
/raw/e4eb3f3ad970026754d8f3e83e926dc1/
e4eb3f3ad970026754d8f3e83e926dc1
bash
Bash
3
2019-07-26T20:00:29
True
False
True
Jun 14, 2013 at 10:06 AM
/api/public/snipt/38062/
come-non-far-morire-le-sessioni-ssh-aggiungendo-questa-riga-in-etcssh_config
<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>Add this in /etc/ssh_config </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>ServerAliveInterval 60 </span></pre></div> </td></tr></table>
ssh

Bash

Semitransparent Dock icons for hidden applications

defaults write com.apple.Dock showhidden -bool YES && killall Dock
https://snipt.net/embed/1f41b000d4e95e4647c593050593845e/
/raw/1f41b000d4e95e4647c593050593845e/
1f41b000d4e95e4647c593050593845e
bash
Bash
1
2016-12-13T11:04:58
True
False
True
Jun 14, 2013 at 10:06 AM
/api/public/snipt/37986/
icone-del-dock-semitrasparenti
<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>defaults write com.apple.Dock showhidden -bool YES <span class="o">&amp;&amp;</span> killall Dock </span></pre></div> </td></tr></table>
"mac osx", dock