Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

Text only

get text to call android

1
2
3
4
5
6
7
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:"+txtPhn.getText().toString()));
callIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
startActivity(callIntent);

set permission into manifest
<uses-permission android:name="android.permission.CALL_PHONE" />
https://snipt.net/embed/a5ce4ccd5a8f914efac17cdf48640d2e/
https://snipt.net/raw/a5ce4ccd5a8f914efac17cdf48640d2e/
a5ce4ccd5a8f914efac17cdf48640d2e
text
Text only
7
2016-12-03T01:39:47
True
False
False
Mar 22, 2016 at 09:56 AM
/api/public/snipt/144849/
get-text-to-call-android
<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>Intent callIntent = new Intent(Intent.ACTION_CALL); </span><span id="L-2"><a name="L-2"></a>callIntent.setData(Uri.parse(&quot;tel:&quot;+txtPhn.getText().toString())); </span><span id="L-3"><a name="L-3"></a>callIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); </span><span id="L-4"><a name="L-4"></a>startActivity(callIntent); </span><span id="L-5"><a name="L-5"></a> </span><span id="L-6"><a name="L-6"></a>set permission into manifest </span><span id="L-7"><a name="L-7"></a>&lt;uses-permission android:name=&quot;android.permission.CALL_PHONE&quot; /&gt; </span></pre></div> </td></tr></table>
android, call, text

PHP

Trim any text in WordPress to desired length

<?php echo wp_trim_words( get_the_content() , '25', '…' ); ?>
https://snipt.net/embed/16ec7cf6a56f30477d395e12bbde0708/
https://snipt.net/raw/16ec7cf6a56f30477d395e12bbde0708/
16ec7cf6a56f30477d395e12bbde0708
php
PHP
1
2016-12-02T07:36:08
True
False
False
Feb 16, 2016 at 12:07 PM
/api/public/snipt/144275/
trim-any-text-in-wordpress-to-desired-length
<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="cp">&lt;?php</span> <span class="k">echo</span> <span class="nx">wp_trim_words</span><span class="p">(</span> <span class="nx">get_the_content</span><span class="p">()</span> <span class="p">,</span> <span class="s1">&#39;25&#39;</span><span class="p">,</span> <span class="s1">&#39;…&#39;</span> <span class="p">);</span> <span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
text, wordpress
Copyrighted, illegal, or inappropriate content? Email [email protected].