View Font Awesome Helper classes for Android
public class MyAppClass extends Application
{
public static Typeface FONT_AWESOME;
public static FontAwesomeHelper FONT_AWESOME_HELPER;
@Override
public void onCreate()
{
super.onCreate();
View gist:9f0d3230b4c381ce7a4d
//This demo app Assumes there are 2 jpg files on the sdcard in the root directory
public class MainActivity extends ActionBarActivity {
ImageView img;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
View gist:6201438
class CreateShareImage extends AsyncTask<String, Void, String> {
@Override
protected void onPreExecute() {
}
@Override
protected String doInBackground(String... params) {
Bitmap bkgImage = BitmapFactory.decodeResource(
MainActivity.this.getResources(), R.drawable.stork);
Bitmap mutableBitmap = bkgImage.copy(Bitmap.Config.ARGB_8888, true);
View gist:5855364
public class BlehActivity extends Activity {
private Handler handler;
private ProgressBar progress;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
progress = (ProgressBar) findViewById(R.id.progressBar1);
handler = new Handler();
View gist:5767317
String sourceString = "";
HttpURLConnection connection;
OutputStreamWriter request = null;
URL url = null;
String response = null;
String params = "refext=http://offliberty.com&track=" + uri[0];
try {
View gist:5754340
public class ReverseGeoAsync extends AsyncTask<String, String, String> {
public interface AsyncDone {
void networkRequestCompleted(String res);
}
private AsyncDone _listener;
public ReverseGeoAsync(AsyncDone listenerParam) {
_listener = listenerParam;
}
@Override
protected String doInBackground(String... uri) {
View gist:5750508
import com.example.streetview.HttpRequest.NetworkListener;
public class MainActivity extends Activity implements NetworkListener {
ImageView iv;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
iv = (ImageView) findViewById(R.id.img);
View gist:5737023
public class Act extends Activity {
OnTaskCompleted otc = new OnTaskCompleted() {
@Override
public void onTaskCompleted(String result) {
Log.d("onTaskCompleted", result);
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
View gist:5716335
//**in the service (ServiceX)
public static boolean isRunning(Context ctx) {
sharedPref = ctx.getSharedPreferences("my_pref", MODE_PRIVATE);
return sharedPref.getBoolean("running", false);
}
private void setRunning(boolean running) {
sharedPref = getSharedPreferences("my_pref", MODE_PRIVATE);
SharedPreferences.Editor prefEditor = sharedPref.edit();
prefEditor.putBoolean("running", running);
prefEditor.commit();
View gist:5692431
find someDir/ -iname "*.flv" -exec ffmpeg -i {} -sameq -ar 22050 {}.mp4 ";" -ls
vlc * --sout '#transcode{vcodec=h264,vb=92,channels=1,ab=16,samplerate=1024,width=320}:standard{access=http,mux=ts,dst=:666/tv.mp4}' --random --sout-keep
awk -F'[ "]+' '$7 == "/" { ipcount[$1]++ }END { for (i in ipcount) {printf "%15s - %d\n", i, ipcount[i] } }' /var/log/apache2/access.log
ffmpeg -loop 1 -shortest -y -i img.jpg -i snd.wav -acodec copy -vcodec mjpeg out.avi
ls * |sort > play.txt
cat play.txt | while IFS= read -r f; do printf "%05d %s\n" "$RANDOM" "$f"; done | sort -n | cut -c7- >> play.m3u
sed -e 's/$/\nwf.mp4/' -i play.m3u