snipt

Ctrl+h for KB shortcuts

Bash

ImageMagick list supported formats

$ identify -list format|grep -i webp
https://snipt.net/embed/4435a262d53e289d0f8ba79119675c06/
https://snipt.net/raw/4435a262d53e289d0f8ba79119675c06/
4435a262d53e289d0f8ba79119675c06
bash
Bash
1
2016-09-30T05:29:50
True
False
False
/api/public/snipt/135538/
imagemagick-list-supported-formats-8e405b30
<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 id="L-1"><a name="L-1"></a><span class="nv">$ </span>identify -list format<span class="p">|</span>grep -i webp </span></pre></div> </td></tr></table>
bash, conversion, imagemagick

Java

Convert Integer to String or String to Integer

1
2
3
4
5
6
7
//Integer to String
String MyNewString = Integer.toString(MyInteger);

//~~~~~~~~~~~~~~~~~~~~~~~~~~~

//String to Integer
Integer MyNewInteger = Integer.parseInt(MyString);
https://snipt.net/embed/d2aa974b79b73fdf30bee234b3741688/
https://snipt.net/raw/d2aa974b79b73fdf30bee234b3741688/
d2aa974b79b73fdf30bee234b3741688
java
Java
8
2016-09-27T23:54:25
True
False
False
/api/public/snipt/42779/
integer-to-string-string-to-integer
<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 id="L-1"><a name="L-1"></a><span class="c1">//Integer to String</span> </span><span id="L-2"><a name="L-2"></a><span class="n">String</span> <span class="n">MyNewString</span> <span class="o">=</span> <span class="n">Integer</span><span class="o">.</span><span class="na">toString</span><span class="o">(</span><span class="n">MyInteger</span><span class="o">);</span> </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="c1">//~~~~~~~~~~~~~~~~~~~~~~~~~~~</span> </span><span id="L-5"><a name="L-5"></a> </span><span id="L-6"><a name="L-6"></a><span class="c1">//String to Integer</span> </span><span id="L-7"><a name="L-7"></a><span class="n">Integer</span> <span class="n">MyNewInteger</span> <span class="o">=</span> <span class="n">Integer</span><span class="o">.</span><span class="na">parseInt</span><span class="o">(</span><span class="n">MyString</span><span class="o">);</span> </span></pre></div> </td></tr></table>
android, conversion, convert, integer, java, string

Bash

6to4 addresses from IPv4 address

ipv4="192.168.0.194"; sla="5"; printf "2002:%02x%02x:%02x%02x:%04x::1" `echo $ipv4 | tr "." " "` $sla
https://snipt.net/embed/08536d37ef751b2cb14c5a65a8335fa4/
https://snipt.net/raw/08536d37ef751b2cb14c5a65a8335fa4/
08536d37ef751b2cb14c5a65a8335fa4
bash
Bash
1
2016-09-27T20:07:11
True
False
False
/api/public/snipt/23525/
6to4-addresses-from-ipv4-address
<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 id="L-1"><a name="L-1"></a><span class="nv">ipv4</span><span class="o">=</span><span class="s2">&quot;192.168.0.194&quot;</span><span class="p">;</span> <span class="nv">sla</span><span class="o">=</span><span class="s2">&quot;5&quot;</span><span class="p">;</span> <span class="nb">printf</span> <span class="s2">&quot;2002:%02x%02x:%02x%02x:%04x::1&quot;</span> <span class="sb">`</span><span class="nb">echo</span> <span class="nv">$ipv4</span> <span class="p">|</span> tr <span class="s2">&quot;.&quot;</span> <span class="s2">&quot; &quot;</span><span class="sb">`</span> <span class="nv">$sla</span> </span></pre></div> </td></tr></table>
conversion, ip, ipv6, tunneling

C

change the case of any ASCII character

1
2
3
4
# change the case of any ASCII character in C-based languages
uppercase = current & 0xFD; 
lowercase = current | 0x20; 
inverted_case = current ^ 0x20;
https://snipt.net/embed/f6b2385487332aaaee39b8924ced03cd/
https://snipt.net/raw/f6b2385487332aaaee39b8924ced03cd/
f6b2385487332aaaee39b8924ced03cd
c
C
4
2016-09-28T11:00:42
True
False
False
/api/public/snipt/22045/
change-the-case-of-any-ascii-character
<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 id="L-1"><a name="L-1"></a><span class="cp"># change the case of any ASCII character in C-based languages</span> </span><span id="L-2"><a name="L-2"></a><span class="n">uppercase</span> <span class="o">=</span> <span class="n">current</span> <span class="o">&amp;</span> <span class="mh">0xFD</span><span class="p">;</span> </span><span id="L-3"><a name="L-3"></a><span class="n">lowercase</span> <span class="o">=</span> <span class="n">current</span> <span class="o">|</span> <span class="mh">0x20</span><span class="p">;</span> </span><span id="L-4"><a name="L-4"></a><span class="n">inverted_case</span> <span class="o">=</span> <span class="n">current</span> <span class="o">^</span> <span class="mh">0x20</span><span class="p">;</span> </span></pre></div> </td></tr></table>
ascii, case, conversion, text
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.