Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

Text only

HTTP-Date (HTTP/1.1 RFC-2616) regular expression validation (RFC-1123/RFC-850/ANSI C asctime)

(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (?:[0-2][0-9]|3[01]) (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} (?:[01][0-9]|2[0-3]):[012345][0-9]:[012345][0-9] GMT|(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (?:[0-2][0-9]|3[01])-(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-\d{2} (?:[01][0-9]|2[0-3]):[012345][0-9]:[012345][0-9] GMT|(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (?:[ 1-2][0-9]|3[01]) (?:[01][0-9]|2[0-3]):[012345][0-9]:[012345][0-9] \d{4})
https://snipt.net/embed/34a920c3bd75951b7aa4aff6c40a9f28/
https://snipt.net/raw/34a920c3bd75951b7aa4aff6c40a9f28/
34a920c3bd75951b7aa4aff6c40a9f28
text
Text only
1
2016-12-04T07:31:53
True
False
False
Apr 03, 2015 at 04:33 PM
/api/public/snipt/138884/
http-date-regular-expression-validation-rfc-1123rfc-850asctime-f64e6aa3
<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>(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (?:[0-2][0-9]|3[01]) (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} (?:[01][0-9]|2[0-3]):[012345][0-9]:[012345][0-9] GMT|(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (?:[0-2][0-9]|3[01])-(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-\d{2} (?:[01][0-9]|2[0-3]):[012345][0-9]:[012345][0-9] GMT|(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (?:[ 1-2][0-9]|3[01]) (?:[01][0-9]|2[0-3]):[012345][0-9]:[012345][0-9] \d{4}) </span></pre></div> </td></tr></table>
"ANSI C", "RFC 1123", "RFC 2616", "RFC 850", 1123, 2616, 850, Date, HTTP, HTTP-Date, HTTP/1.1, RFC, asctime, expression, format, regular, validation

JavaScript

JS Date formatter

1
2
3
4
5
6
7
/*
 * Función formateadora de fechas.
 */
function dateFormatter(dateAsLong) {
	var date = new Date(dateAsLong);
	return date.getDate() + "/" + (date.getMonth() + 1) + "/" + date.getFullYear() + " " + date.getHours() + ":" + date.getMinutes();
}
https://snipt.net/embed/878440b0b9c96f05a6fad01f29bf24cf/
https://snipt.net/raw/878440b0b9c96f05a6fad01f29bf24cf/
878440b0b9c96f05a6fad01f29bf24cf
js
JavaScript
7
2016-12-04T07:35:33
True
False
False
May 05, 2014 at 05:38 AM
/api/public/snipt/134736/
js-date-formatter-9e1198a7
<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="cm">/*</span> </span><span id="L-2"><a name="L-2"></a><span class="cm"> * Función formateadora de fechas.</span> </span><span id="L-3"><a name="L-3"></a><span class="cm"> */</span> </span><span id="L-4"><a name="L-4"></a><span class="kd">function</span> <span class="nx">dateFormatter</span><span class="p">(</span><span class="nx">dateAsLong</span><span class="p">)</span> <span class="p">{</span> </span><span id="L-5"><a name="L-5"></a> <span class="kd">var</span> <span class="nx">date</span> <span class="o">=</span> <span class="k">new</span> <span class="nb">Date</span><span class="p">(</span><span class="nx">dateAsLong</span><span class="p">);</span> </span><span id="L-6"><a name="L-6"></a> <span class="k">return</span> <span class="nx">date</span><span class="p">.</span><span class="nx">getDate</span><span class="p">()</span> <span class="o">+</span> <span class="s2">&quot;/&quot;</span> <span class="o">+</span> <span class="p">(</span><span class="nx">date</span><span class="p">.</span><span class="nx">getMonth</span><span class="p">()</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot;/&quot;</span> <span class="o">+</span> <span class="nx">date</span><span class="p">.</span><span class="nx">getFullYear</span><span class="p">()</span> <span class="o">+</span> <span class="s2">&quot; &quot;</span> <span class="o">+</span> <span class="nx">date</span><span class="p">.</span><span class="nx">getHours</span><span class="p">()</span> <span class="o">+</span> <span class="s2">&quot;:&quot;</span> <span class="o">+</span> <span class="nx">date</span><span class="p">.</span><span class="nx">getMinutes</span><span class="p">();</span> </span><span id="L-7"><a name="L-7"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
Date, JS, format

PHP

Prendere nome mese dal numero

1
2
3
<?php
$nav_title = date("F", mktime(0, 0, 0, $mese, 10));
?>
https://snipt.net/embed/ebe88182ca9a70b904dc524b409f56c7/
https://snipt.net/raw/ebe88182ca9a70b904dc524b409f56c7/
ebe88182ca9a70b904dc524b409f56c7
php
PHP
3
2016-12-05T10:57:48
True
False
False
Mar 25, 2013 at 05:26 PM
/api/public/snipt/58259/
prendere-nome-mese-dal-numero
<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="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a><span class="nv">$nav_title</span> <span class="o">=</span> <span class="nb">date</span><span class="p">(</span><span class="s2">&quot;F&quot;</span><span class="p">,</span> <span class="nb">mktime</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="nv">$mese</span><span class="p">,</span> <span class="mi">10</span><span class="p">));</span> </span><span id="L-3"><a name="L-3"></a><span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
date, format, php

Python

Plot format defaults in Matplotlib

1
2
3
4
rc('font', family='serif')
rc('font', serif='Times New Roman')
rc('font', size=20)
rc('lines', linewidth=2)
https://snipt.net/embed/7cd75e7b22bd620b5f76c2768ad063a0/
https://snipt.net/raw/7cd75e7b22bd620b5f76c2768ad063a0/
7cd75e7b22bd620b5f76c2768ad063a0
python
Python
4
2016-12-04T07:37:54
True
False
False
Nov 20, 2012 at 01:57 PM
/api/public/snipt/50528/
plot-format-defaults-in-matplotlib
<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="n">rc</span><span class="p">(</span><span class="s1">&#39;font&#39;</span><span class="p">,</span> <span class="n">family</span><span class="o">=</span><span class="s1">&#39;serif&#39;</span><span class="p">)</span> </span><span id="L-2"><a name="L-2"></a><span class="n">rc</span><span class="p">(</span><span class="s1">&#39;font&#39;</span><span class="p">,</span> <span class="n">serif</span><span class="o">=</span><span class="s1">&#39;Times New Roman&#39;</span><span class="p">)</span> </span><span id="L-3"><a name="L-3"></a><span class="n">rc</span><span class="p">(</span><span class="s1">&#39;font&#39;</span><span class="p">,</span> <span class="n">size</span><span class="o">=</span><span class="mi">20</span><span class="p">)</span> </span><span id="L-4"><a name="L-4"></a><span class="n">rc</span><span class="p">(</span><span class="s1">&#39;lines&#39;</span><span class="p">,</span> <span class="n">linewidth</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> </span></pre></div> </td></tr></table>
"plot format default", Matplotlib, Python, default, format, plot
Copyrighted, illegal, or inappropriate content? Email [email protected].