Skip to content

Instantly share code, notes, and snippets.

View rtanglao's full-sized avatar
😃
you rock :-)

Roland Tanglao rtanglao

😃
you rock :-)
View GitHub Profile
@rtanglao
rtanglao / flickrlinks.md
Created September 13, 2010 18:07
flickr api & other related flickr links
@rtanglao
rtanglao / downloadOriginals.rb
Created September 15, 2010 06:09
download flickr original photos using metadata from stdin or file specified as command line argument
#!/usr/bin/env ruby
require 'json'
require 'pp'
require 'curb'
# requires serialized flickr json file to be $stdin or specified on the command line and then
# downloads the files to the current directory
def chunk_array(array, pieces=2)
len = array.length;
mid = (len/pieces)
chunks = []
@rtanglao
rtanglao / rolands.endless.vancouver.html
Created September 18, 2010 06:45
roland's endless vancouver photos
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="viewport" content="initial-scale = 1.0,maximum-scale = 1.0,width=device-width"/>
<script src="../oni-apollo.js" type="text/javascript"></script>
<script type="text/sjs">
// roland's hacked version, change the YQL query below and do your own
// photo mashup!
@rtanglao
rtanglao / rolands.endless.gastown.html
Created September 18, 2010 07:32
roland's endless gastown photos
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="viewport" content="initial-scale = 1.0,maximum-scale = 1.0,width=device-width"/>
<script src="../oni-apollo.js" type="text/javascript"></script>
<script type="text/sjs">
// roland's hacked version, change the YQL query below and do your own
// photo mashup!
@rtanglao
rtanglao / blink3leds.c
Created September 19, 2010 23:11
blink 3 leds attached to the nerd kit
// led_blink.c
// for NerdKits with ATmega168
// [email protected]
#define F_CPU 14745600
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <inttypes.h>
@rtanglao
rtanglao / downloadSq.rb
Created September 20, 2010 06:15
download flickr "sq" (square 75x75) photos using metadata from stdin or file specified as command line argument
#!/usr/bin/env ruby
require 'json'
require 'pp'
require 'curb'
# requires serialized flickr json file to be $stdin or specified on the command line and then
# downloads the flickr "sq" (75x75) files to the current directory
def chunk_array(array, pieces=2)
len = array.length;
mid = (len/pieces)
chunks = []
@rtanglao
rtanglao / downloadSequentialSq.rb
Created September 22, 2010 00:28
download "sq" 75x75 flickr photos 1 at a time
#!/usr/bin/env ruby
require 'json'
require 'pp'
require 'curb'
# requires serialized flickr json file to be $stdin or specified on the command line and then
# downloads the flickr "sq" (75x75) files to the current directory
def fetch_1_at_a_time(urls)
easy = Curl::Easy.new
easy.follow_location = true
@rtanglao
rtanglao / downloadZ.rb
Created September 23, 2010 02:35
download flickr "Z" size photos which for 5MP originals is oddly 640x481
#!/usr/bin/env ruby
require 'json'
require 'pp'
require 'curb'
# requires serialized flickr json file to be $stdin or specified on the command line and then
# downloads the flickr "Z" files which are 640x481 for 5MP originals (481 is odd methinks!) to the current directory
def fetch_1_at_a_time(urls)
easy = Curl::Easy.new
easy.follow_location = true
@rtanglao
rtanglao / pick300-480.rb
Created September 23, 2010 06:10
pick 300 random 640x480 flickr pics and save them to current directory
#!/usr/bin/env ruby
require 'json'
require 'pp'
require 'fileutils'
require 'getoptlong'
# requires serialized flickr json file to be $stdin or specified on the command line and then
# copies flickr "Z" files which are 640x480 to the current directory
# for 5MP original somehow height is 481 (flickr bug?) so 481 height jpgs are ignored
# 1 parameter is required: "-d directory" where directory is the directory with the Z files
@rtanglao
rtanglao / marker-cluster.html
Created September 26, 2010 08:25
map of all 3700 gastown photos
We couldn’t find that file to show.