Skip to content

Instantly share code, notes, and snippets.

View planetguru's full-sized avatar

Christopher Lacy-Hulbert planetguru

View GitHub Profile
#include <stdlib.h>
#include <stdio.h>
int * score( int[], int[] );
int main( void ){
int result[2];
int codeword[4] = {2,2,2,3};
int testword[4] = {3,3,1,2};
// download all flickr images from a given userid
// userid is embedded in this url
$key = "enterkeyhere";
$url = "".$key."&user_id=120759744%40N07&per_page=80&page=";
$append = "&format=json&nojsoncallback=1";
for($i=1; $i<4; $i++){ // 3 pages of 80 images
$uri = $url.$i.$append;
# convert images from source to create buffer frames for blending
convert -verbose flickrcam/*jpg -delay 10 -morph 10 flickranim/%05d.morph.jpg
# run through ffmpeg to combine/transcode to mp4
ffmpeg -r 25 -i flickranim/%05d.morph.jpg flickranim/output.mp4
planetguru / gist:5775814
Created June 13, 2013 17:53
Add this to your .profile,or .bashrc or whatever to create a note-taking utility for your shell. Notes are invoked by typing $> note observations.txt from any working directory. You will then find yourself editing a file called observations.txt in ~/Documents/notes/ Don't forget to change the username from 'christo' to something useful
note() { /usr/bin/vim /Users/christo/Documents/notes/"$@".txt ; }
planetguru / Android Async data fetch
Created March 26, 2013 10:05
Android/Java code for managing download/service access tasks asynchronously via a generic query task and generic fetchdata method..
private class QueryTask extends AsyncTask<String, Void, String> {
String role = new String();
protected String doInBackground(String... querySections) {
/* querySections: requestURL, requestQuery, role (index/data) */
String data = "", requestQuery = new String();
role = querySections[2];
try {
requestQuery = URLEncoder.encode(querySections[1], "UTF-8");