This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$string = <<<EOF | |
<p dir="rtl"> | |
أَفَلاَ يَتَدَبَّرُونَ الْقُرْآنَ وَلَوْ كَانَ مِنْ عِندِ غَيْرِ اللّهِ لَوَجَدُواْ فِيهِ اخْتِلاَفًا كَثِيرًا | |
</p> | |
EOF; | |
preg_match('/<p dir=(?:"rtl"|\'rtl\')>([\x{0600}-\x{06FF}\x{0750}-\x{077F}\x{FB50}-\x{FDFF}\x{FE70}-\x{FEFF} \r\n]+)<\/p>/um', $string, $matches); | |
$match = $matches[1]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get either a Gravatar URL or complete image tag for a specified email address. | |
* | |
* @param string $email The email address | |
* @param string $s Size in pixels, defaults to 80px [ 1 - 512 ] | |
* @param string $d Default imageset to use [ 404 | mm | identicon | monsterid | wavatar ] | |
* @param string $r Maximum rating (inclusive) [ g | pg | r | x ] | |
* @param boole $img True to return a complete IMG tag False for just the URL | |
* @param array $atts Optional, additional key/value attributes to include in the IMG tag | |
* @return String containing either just a URL or a complete image tag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Activity; | |
import android.content.Intent; | |
import android.net.Uri; | |
import android.os.Bundle; | |
import android.view.KeyEvent; | |
import android.view.View; | |
import android.widget.Button; | |
import android.widget.EditText; | |
import android.widget.LinearLayout; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Activity; | |
import android.content.Intent; | |
import android.net.Uri; | |
import android.os.Bundle; | |
import android.view.KeyEvent; | |
import android.view.View; | |
import android.widget.Button; | |
import android.widget.EditText; | |
import android.widget.LinearLayout; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
import a_vcard.android.syncml.pim.PropertyNode; | |
import a_vcard.android.syncml.pim.VDataBuilder; | |
import a_vcard.android.syncml.pim.VNode; | |
import a_vcard.android.syncml.pim.vcard.VCardException; | |
import a_vcard.android.syncml.pim.vcard.VCardParser; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
URL u = new URL("http://hanigamal.net/resume.pdf"); | |
HttpURLConnection c = (HttpURLConnection) u.openConnection(); | |
c.setRequestMethod("GET"); | |
c.setDoOutput(true); | |
c.connect(); | |
String fileName = Environment.getExternalStorageDirectory().getAbsolutePath(); | |
FileOutputStream f = new FileOutputStream(new File(fileName,"my.pdf")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.util.*; | |
import java.net.*; | |
/** | |
* An smart MP3/OGG HTTP server that translates M3U playlist files | |
* | |
* <p> Mp3HTTPD version 1.04, | |
* Copyright © 2001,2005 Jarno Elonen ([email protected]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean isNetworkAvailable() { | |
Context context = getApplicationContext(); | |
ConnectivityManager connectivity = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); | |
if (connectivity == null) { | |
boitealerte(this.getString(R.string.alert),"getSystemService rend null"); | |
} else { | |
NetworkInfo[] info = connectivity.getAllNetworkInfo(); | |
if (info != null) { | |
for (int i = 0; i < info.length; i++) { | |
if (info[i].getState() == NetworkInfo.State.CONNECTED) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.ByteArrayInputStream; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.OutputStream; | |
import java.io.PrintStream; | |
import java.io.PrintWriter; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Twitter status update bot by http://360percents.com | |
#Author: Luka Pusic <[email protected]> | |
#REQUIRED PARAMS | |
username="[email protected]" | |
password="yourpassw0rd" | |
tweet="$*" #must be less than 140 chars | |
#EXTRA OPTIONS |