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 / writeLatLongJSStdout.rb
Created September 26, 2010 08:26
read lat/lon from flickr serialized json metadata
#!/usr/bin/env ruby
require 'json'
require 'pp'
pages = 0
total = 0
perpage = 0
ARGF.each_line do |line|
serializedJSON = line
@rtanglao
rtanglao / markpoints.html
Created September 27, 2010 01:05
mark all 3700 gastown photo locations
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Gastown</title>
</head>
<body>
<div id="cm-example" style="width: 800px; height: 600px"></div>
<script type="text/javascript" src="http://tile.cloudmade.com/wml/latest/web-maps-lite.js"></script>
<script type="text/javascript" src="sample-points.js"></script>
@rtanglao
rtanglao / markVancouverpoints.html
Created September 27, 2010 04:26
map with Roland's 21000 geotagged cameraphone photos
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Roland's Vancouver Geotagged Cameraphone Pics</title>
</head>
<body>
<div id="cm-example" style="width: 800px; height: 600px"></div>
<script type="text/javascript" src="http://tile.cloudmade.com/wml/latest/web-maps-lite.js"></script>
<script type="text/javascript" src="vancouver-sample-points.js"></script>
@rtanglao
rtanglao / markVancouverChromelesspoints.html
Created September 27, 2010 23:28
mapWith2100VancouverCameraphonePhotos
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Roland's Vancouver Geotagged Cameraphone Pics</title>
</head>
<body>
<div id="cm-example" style="width: 800px; height: 600px"></div>
<script type="text/javascript" src="http://tile.cloudmade.com/wml/latest/web-maps-lite.js"></script>
<script type="text/javascript" src="vancouver-sample-points.js"></script>
@rtanglao
rtanglao / getAverageColour.rb
Created September 29, 2010 04:23
get average colour of flickr photos from serialized JSON
#!/usr/bin/env ruby
require 'net/http'
require 'uri'
require 'xmlsimple'
require 'pp'
require 'json'
#pp data["variable"][6]["statistic"][0]["rgb"] # or "hex" or "value"
ARGF.each_line do |line|
@rtanglao
rtanglao / avg-vancouver-sample-points.js
Created September 29, 2010 07:27
average colour map of Vancouver generator
var samplePoints = [
[49.280277,-123.111667,0x91be72],
[49.277777,-123.099723,0x96948f],
[49.279166,-123.109723,0x919088],
[49.277777,-123.099723,0x92918b],
[49.277777,-123.099723,0x949590],
[49.28,-123.110834,0x83857d],
[49.266388,-123.073612,0x938e85],
[49.269722,-123.073612,0x7c8987],
[49.278611,-123.107778,0x8993a2],
@rtanglao
rtanglao / writeLatLongJSAvgColourStdout.rb
Created September 29, 2010 07:34
write js lat,long,avg colour to stdout
#!/usr/bin/env ruby
require 'json'
require 'pp'
pages = 0
total = 0
perpage = 0
ARGF.each_line do |line|
serializedJSON = line
@rtanglao
rtanglao / gastown-avg-colour-sample-points.js
Created September 30, 2010 07:05
average color of Gastown Map Generator
var samplePoints = [
[49.279166,-123.109723,0x919088],
[49.282222,-123.11,0x75787b],
[49.278611,-123.107778,0x8993a2],
[49.277777,-123.106945,0x67727a],
[49.2775,-123.105556,0x7a8081],
[49.282222,-123.109723,0x5e564e],
[49.2775,-123.105834,0x80847e],
[49.278611,-123.108889,0xa7a59e],
[49.2775,-123.105,0x7c8079],
@rtanglao
rtanglao / GoogleCode.pde
Created September 30, 2010 21:48
display average colour in a grid using processing
//Function to get an Array of integers from a Google Spreadsheet
int[] getNumbers() {
String lines[] = loadStrings("coloursForProcessing3.txt");
println("there are " + lines.length + " lines");
int[] returnArray = new int[lines.length];
for (int i=0; i < lines.length; i++) {
println("line:"+i+":"+lines[i]);
returnArray[i] = int(lines[i]);
};
@rtanglao
rtanglao / GoogleCode.pde
Created October 1, 2010 04:58
vancouverAverageColourFromRolands21000cameraphonePhotos
//Function to get an Array of integers from a Google Spreadsheet
int[] getNumbers() {
String lines[] = loadStrings("coloursForProcessing3.txt");
println("there are " + lines.length + " lines");
int[] returnArray = new int[lines.length];
for (int i=0; i < lines.length; i++) {
println("line:"+i+":"+lines[i]);
returnArray[i] = int(lines[i]);
};