Download Youtube Videos using Ruby or PHP
Just copy the appropriate script, provide the video_id
and run. It will list download links for different qualities and streams.
:P
#!/bin/env ruby | |
#### This Ruby Script extracts Captions as .srt files from | |
#### MediaStorm Videos (http://mediastorm.com) | |
#### Download The Video, and if you want to download captions, | |
#### lookup the 'Network' tab in Inspector to see the video id | |
#### It'll be a GET request to two xml documents on the mediastorm | |
#### server, namely; /timecodes/<id> and /phrases/<id> |
public class SimpleJSON { | |
/** | |
* @author: Sheharyar Naseer (@sheharyarn) | |
* @license: MIT | |
*/ | |
public static Object toJSON(Object object) throws JSONException { | |
if (object instanceof HashMap) { | |
JSONObject json = new JSONObject(); | |
HashMap map = (HashMap) object; |
I hereby claim:
To claim this, I am signing this object:
I use these snippets to implement Google Now Card appear-animations on Android. Add these two files to your res/anim/
folder and add a swing_anim_time
integer to your values:
<!-- res/values/strings.xml -->
<integer name="swing_anim_time">750</integer>
// The Very Basic | |
new AsyncTask<Void, Void, Void>() { | |
protected void onPreExecute() { | |
// Pre Code | |
} | |
protected Void doInBackground(Void... unused) { | |
// Background Code | |
return null; | |
} | |
protected void onPostExecute(Void unused) { |
RequestParams params = new RequestParams(); | |
params.put("email", "[email protected]"); | |
params.put("password", "12345678"); | |
APIClient.post("/login", params, new JsonHttpResponseHandler() { | |
// @Override them all | |
public void onStart() { } // Runs before anything else | |
public void onFinish() { } // Runs after everything else | |
public class SQLiteHelper extends SQLiteOpenHelper { | |
private static final String BOOK_TABLE = "books"; | |
private static final HashMap<String, String> BOOK_FIELDS = new HashMap<String, String>() {{ | |
put("title", "TEXT"); | |
put("author", "TEXT"); | |
put("sales", "INTEGER"); // Neatly write fields and their types | |
}}; | |
// ... |
Running this script will create three shortcuts (aliases) on your Server:
current
release of your app (capistrano)production.log
of the current
release of your app.This script follows the ~/apps/appname/current
directory structure.
#!/bin/bash | |
MONGO_DATABASE="your_db_name" | |
APP_NAME="your_app_name" | |
MONGO_HOST="127.0.0.1" | |
MONGO_PORT="27017" | |
TIMESTAMP=`date +%F-%H%M` | |
MONGODUMP_PATH="/usr/bin/mongodump" | |
BACKUPS_DIR="/home/username/backups/$APP_NAME" |