Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

JavaScript

Online lighting retrofit calculator widget

1
2
3
4
<script type='text/javascript'>var $p2jq = jQuery.noConflict();</script>
<script type="text/javascript" src="http://www.p-2.com/calculator/p2calc.js"></script>
<div id="p2calculator"> </div>
<p style="text-align: center;"><a href="http://www.p-2.com">Lighting Retrofit</a> calculator provided by [P2].</p>
https://snipt.net/embed/ae3cb6cf4458846eaa05b15f8b6a2f47/
https://snipt.net/raw/ae3cb6cf4458846eaa05b15f8b6a2f47/
ae3cb6cf4458846eaa05b15f8b6a2f47
js
JavaScript
4
2016-12-02T07:03:00
True
False
False
/api/public/snipt/19290/
lighting-retrofit-calculator
<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="o">&lt;</span><span class="nx">script</span> <span class="nx">type</span><span class="o">=</span><span class="s1">&#39;text/javascript&#39;</span><span class="o">&gt;</span><span class="kd">var</span> <span class="nx">$p2jq</span> <span class="o">=</span> <span class="nx">jQuery</span><span class="p">.</span><span class="nx">noConflict</span><span class="p">();</span><span class="o">&lt;</span><span class="err">/script&gt;</span> </span><span id="L-2"><a name="L-2"></a><span class="o">&lt;</span><span class="nx">script</span> <span class="nx">type</span><span class="o">=</span><span class="s2">&quot;text/javascript&quot;</span> <span class="nx">src</span><span class="o">=</span><span class="s2">&quot;http://www.p-2.com/calculator/p2calc.js&quot;</span><span class="o">&gt;&lt;</span><span class="err">/script&gt;</span> </span><span id="L-3"><a name="L-3"></a><span class="o">&lt;</span><span class="nx">div</span> <span class="nx">id</span><span class="o">=</span><span class="s2">&quot;p2calculator&quot;</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="err">/div&gt;</span> </span><span id="L-4"><a name="L-4"></a><span class="o">&lt;</span><span class="nx">p</span> <span class="nx">style</span><span class="o">=</span><span class="s2">&quot;text-align: center;&quot;</span><span class="o">&gt;&lt;</span><span class="nx">a</span> <span class="nx">href</span><span class="o">=</span><span class="s2">&quot;http://www.p-2.com&quot;</span><span class="o">&gt;</span><span class="nx">Lighting</span> <span class="nx">Retrofit</span><span class="o">&lt;</span><span class="err">/a&gt; calculator provided by [P2].&lt;/p&gt;</span> </span></pre></div> </td></tr></table>
calculator, widget

Bash

Simple command line calculator

1
2
3
4
5
calc(){ awk "BEGIN{ print $* }" ;}

# some usage examples:
# calc 3+3
# calc "((3+(2^3)) * 34^2 / 9)-75.89"
https://snipt.net/embed/7faaa5d5568ff03b32b9cba1dbe5b8e7/
https://snipt.net/raw/7faaa5d5568ff03b32b9cba1dbe5b8e7/
7faaa5d5568ff03b32b9cba1dbe5b8e7
bash
Bash
5
2016-12-02T14:41:52
True
False
False
/api/public/snipt/9590/
simple-command-line-calculator
<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>calc<span class="o">(){</span> awk <span class="s2">&quot;BEGIN{ print </span><span class="nv">$*</span><span class="s2"> }&quot;</span> <span class="p">;</span><span class="o">}</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="c1"># some usage examples:</span> </span><span id="L-4"><a name="L-4"></a><span class="c1"># calc 3+3</span> </span><span id="L-5"><a name="L-5"></a><span class="c1"># calc &quot;((3+(2^3)) * 34^2 / 9)-75.89&quot;</span> </span></pre></div> </td></tr></table>
awk, bash, calculator
Copyrighted, illegal, or inappropriate content? Email [email protected].