Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeffrey Warren jywarren

View GitHub Profile
@jywarren
jywarren / zoom hashes in Google Maps
Created Apr 18, 2011
Live URL hash updating as you drag a Google Map around. That way the URL is always the permalink for your current viewport.
View zoom hashes in Google Maps
function makeLink() {
location.hash = "#/"+map.getCenter().lat().toFixed(3)+"/"+map.getCenter().lng().toFixed(3)+"/"+map.getZoom();
}
function initialize() {
var query = location.search.substring(1);
var lat = 0.5;
var lng = 0.5;
View LensFun XML database format
<lens>
<maker>Pentax</maker>
<model>SMC PENTAX DA 12-24mm F/4 ED AL IF</model>
<mount>Pentax KAF2</mount>
<cropfactor>1.5</cropfactor>
<calibration>
<distortion model="poly3" focal="12" k1="-0.01919" />
<distortion model="poly3" focal="15" k1="-0.00774" />
<distortion model="poly3" focal="18" k1="-0.00345" />
<distortion model="poly3" focal="21" k1="-0.00199" />
@jywarren
jywarren / localwiki-install-error-transcript.txt
Created Dec 6, 2011
LocalWiki install error transcript
View localwiki-install-error-transcript.txt
Database 'localwiki' with username 'localwiki' created!
Get a Cloudmade API Key.
1. Go to http://cloudmade.com/register
2. After you've signed in, click "Get an API Key". Fill out the form (details don't matter)
3. Paste the API key below:
e1cdd6df85e44b16932beedcf0868c56
Traceback (most recent call last):
File "/usr/bin/localwiki-manage", line 9, in <module>
load_entry_point('localwiki==0.2.beta.12', 'console_scripts', 'localwiki-manage')()
File "/usr/lib/pymodules/python2.6/sapling/manage.py", line 57, in main
View end-of-pg_hba.conf
# Database administrative login by UNIX sockets
local all postgres ident
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
#local all all md5
# IPv4 local connections:
#host all all 127.0.0.1/32 md5
# IPv6 local connections:
@jywarren
jywarren / blinkm-maxm-rgb-knob.ino
Created Dec 8, 2011
BlinkM MaxM RGB color from a knob
View blinkm-maxm-rgb-knob.ino
/*
* BlinkKnobHue -- Example of how to use a pot to set BlinkM hue
*
*
* For more info on how to use pots and analog inputs see:
* http://www.arduino.cc/en/Tutorial/AnalogInput
*
* BlinkM connections to Arduino
* PWR - -- gnd -- black -- Gnd
* PWR + -- +5V -- red -- 5V
@jywarren
jywarren / hsv_rgb_led_thermistor.ino
Created Dec 8, 2011
HSV RGB LED from thermistor
View hsv_rgb_led_thermistor.ino
#include <math.h>
double Thermister(int RawADC) {
double Temp;
Temp = log(((10240000/RawADC) - 10000));
Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp );
Temp = Temp - 273.15; // Convert Kelvin to Celcius
//Temp = (Temp * 9.0)/ 5.0 + 32.0; // Convert Celcius to Fahrenheit
return Temp;
}
@jywarren
jywarren / ArduinoTemperatureFlashlight.ino
Created Dec 12, 2011 — forked from kylemcdonald/ArduinoTemperatureFlashlight.ino
Thermal Flashlight RGB LED + Melexis 90614
View ArduinoTemperatureFlashlight.ino
#include <i2cmaster.h>
#include "Wire.h"
#include "BlinkM_funcs.h"
const float lowReading = 75;
const float highReading = 110;
const int blinkm_addr = 0;
const unsigned char separatorCharacter = 255;
void setup(){
@jywarren
jywarren / ThermalFlashlight.ino
Created Dec 12, 2011
Thermal Flashlight (RGB LED + Melexis 90614 + Arduino)
View ThermalFlashlight.ino
// See http://bildr.org/2011/02/mlx90614-arduino/ for i2c library and instructions
// You must download the "twimaster.cpp" and "i2cmaster.h" files, and place them in a folder called "I2Cmaster". This must be placed in a folder called "libraries" which in turn should be placed in your Sketchbook folder (see Arduino's Preferences menu item to see where this is on your machine.).
// Typically, once you install these files, you must relaunch Arduino.
// The extra files are included in this Gist, as well as attached to the page http://publiclaboratory.org/tool/thermal-camera
#include <i2cmaster.h>
#include "Wire.h"
//#include "BlinkM_funcs.h"
@jywarren
jywarren / related_maps.php
Created Dec 21, 2011
Related maps in PLOTS website (drupal)
View related_maps.php
View shakespeare.rb
upon "expound"
thrice.dost_thou do
speaketh("Hark!")
verily
ponder(1..3)
verily