Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

Text only

Protect email from Spambots

/** Protect email address from Spambots  use with [mailto][email protected][/mailto] */
function my_mail_shortcode( $atts , $content=null ) {     for ($i = 0; $i < strlen($content); $i++) $encodedmail .= "&#" . ord($content[$i]) . ';';      return '<a href="mailto:'.$encodedmail.'">'.$encodedmail.'</a>'; } add_shortcode('mailto', 'my_mail_shortcode');
https://snipt.net/embed/a2a708a776523b7116b37da85f2b0642/
https://snipt.net/raw/a2a708a776523b7116b37da85f2b0642/
a2a708a776523b7116b37da85f2b0642
text
Text only
2
2016-12-06T11:25:28
True
False
False
/api/public/snipt/98323/
protect-email-from-spambots
<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>/** Protect email address from Spambots use with [mailto][email protected][/mailto] */ </span><span id="L-2"><a name="L-2"></a>function my_mail_shortcode( $atts , $content=null ) { for ($i = 0; $i &lt; strlen($content); $i++) $encodedmail .= &quot;&amp;#&quot; . ord($content[$i]) . &#39;;&#39;; return &#39;&lt;a href=&quot;mailto:&#39;.$encodedmail.&#39;&quot;&gt;&#39;.$encodedmail.&#39;&lt;/a&gt;&#39;; } add_shortcode(&#39;mailto&#39;, &#39;my_mail_shortcode&#39;); </span></pre></div> </td></tr></table>
email, shortcode

PHP

EmailToName

1
2
3
4
5
6
function EmailToName($email) {
$output = str_replace(array('.', '-', '_', ',', ':'), ' ', substr($email, 0, strpos($email, '@')));
$output = str_replace(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9), '', $output);
$output = ucwords($output);
return $output;
}
https://snipt.net/embed/586882827ff932dd449b4d2074c47c67/
https://snipt.net/raw/586882827ff932dd449b4d2074c47c67/
586882827ff932dd449b4d2074c47c67
php
PHP
6
2016-12-07T03:33:11
True
False
False
/api/public/snipt/79063/
emailtoname
<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="x">function EmailToName($email) {</span> </span><span id="L-2"><a name="L-2"></a><span class="x">$output = str_replace(array(&#39;.&#39;, &#39;-&#39;, &#39;_&#39;, &#39;,&#39;, &#39;:&#39;), &#39; &#39;, substr($email, 0, strpos($email, &#39;@&#39;)));</span> </span><span id="L-3"><a name="L-3"></a><span class="x">$output = str_replace(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9), &#39;&#39;, $output);</span> </span><span id="L-4"><a name="L-4"></a><span class="x">$output = ucwords($output);</span> </span><span id="L-5"><a name="L-5"></a><span class="x">return $output;</span> </span><span id="L-6"><a name="L-6"></a><span class="x">}</span> </span></pre></div> </td></tr></table>
email, extract_name, php

Bash

Total messages for plesk email

find /var/qmail/mailnames/EXAMPLE.COM/USERNAME/Maildir/ -type f -print | wc -l
https://snipt.net/embed/0ded253230208f3896197fedb0a42453/
https://snipt.net/raw/0ded253230208f3896197fedb0a42453/
0ded253230208f3896197fedb0a42453
bash
Bash
1
2016-12-07T03:33:43
True
False
False
Jun 27, 2013 at 08:03 PM
/api/public/snipt/65909/
total-messages-for-plesk-email
<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>find /var/qmail/mailnames/EXAMPLE.COM/USERNAME/Maildir/ -type f -print <span class="p">|</span> wc -l </span></pre></div> </td></tr></table>
email, plesk
Copyrighted, illegal, or inappropriate content? Email [email protected].