Skip to content

Instantly share code, notes, and snippets.

Avatar
🔰
( ͡ᵔ ͜ʖ ͡ᵔ )

Max Ogden maxogden

🔰
( ͡ᵔ ͜ʖ ͡ᵔ )
View GitHub Profile
@maxogden
maxogden / gist:249877
Created Dec 5, 2009
lists images in a directory, returns javascript array
View gist:249877
require 'pow'
class JPEG
attr_reader :width, :height, :bits
def initialize(file)
if file.kind_of? IO
examine(file)
else
File.open(file, 'rb') { |io| examine(io) }
View jQuery Live MobileSafari Click Bug
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>
MobileSafari Live Click Bug
</title>
<script src='http://code.jquery.com/jquery-git.js' type='text/javascript'></script>
<script src='http://media.lib.byu.edu/js/jquery/plugins/jquery.livequery-1.0.3.js' type='text/javascript'></script>
</head>
<body style='font-family: Helvetica;'>
@maxogden
maxogden / hash table in pure ruby
Created Feb 3, 2010
simple hash table in pure ruby
View hash table in pure ruby
class GammaDonkey
def initialize
@data = Array.new
@keys = Array.new
end
def hashed(value)
magic = 2166136261
value.each_byte {|byte| magic = ( magic * 16777619 ) ^ byte}
magic
@maxogden
maxogden / .bash_profile.sh
Created Apr 9, 2010
irbrc with textmate's sunburst colors and other fun enhancements
View .bash_profile.sh
export PS1='\[\033[36m\]\W\[\033[m\] $(__git_ps1 "(\[\033[32m\]%s\[\033[m\]) ")\[\033[31m\]→\[\033[m\] '
export CLICOLOR=1
export LS_COLORS=exfxcxdxbxegedabagacad
source ~/.git_completion.sh
View frob_town
<html>
<head>
<script src='http://code.jquery.com/jquery-1.4.2.min.js'></script>
<script src='http://github.com/desandro/masonry/raw/master/js/jquery.masonry.min.js'></script>
<script src='http://plugins.jquery.com/files/jquery.md5.js.txt'></script>
<script src='http://github.com/xaviershay/jquery-enumerable/raw/master/jquery.enumerable.js'></script>
<link rel="stylesheet" type="text/css" href="http://github.com/desandro/masonry/raw/master/css/masonry-example.css" media="screen" charset="utf-8" />
<script>
var secret = 'SUCK_IT_HACKERSZ';
@maxogden
maxogden / instamapper_to_latitude.rb
Created May 20, 2010
gets data from instamapper and saves it to your google latitude account
View instamapper_to_latitude.rb
require 'rubygems'
require 'json'
require 'net/http'
require 'redis'
require 'oauth'
@redis = Redis.new
@instamapper_api_key = "YOUR INSTAMAPPER API KEY"
@consumer_key = "GOOGLE OAUTH CONSUMER KEY"
@consumer_secret = "GOOGLE OAUTH CONSUMER SECRET"
View geojson.html
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="openlayers/theme/default/style.css" type="text/css" />
<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAUXDSXET8IRGdgHP9FpGw5BT-fVzUWGS_eJ2ZLPBO_6yPqTi0vhQKAzahOrduDq0xQk09GR-UP3Jgcg'></script>
<script src="openlayers/lib/OpenLayers.js"></script>
<script src='jquery-1.4.2.min.js'></script>
<script src='jquery.enumerable.js'></script>
<script type="text/javascript">
var lon = -122.548188;
View IRC_mention_notifier.rb
# PROBLEM: when someone replies to you publicly in an IRC channel you may not be
# notified of it if you are away from your computer. The common format for public
# replies looks like this:
#
# <jchris> maxo_: yeah mine is way better
#
# SOLUTION: Sign up for notifo as both a supplier and a consumer, and install the
# notifo app on your smartphone. Execute this in cron every minute to have new
# mentions sent to your phone as push notifications.
#
View protovis_example.html
<html>
<head>
<title>Data</title>
<script type="text/javascript" src="http://protovis-js.googlecode.com/svn/trunk/protovis-r3.1.js"></script>
</head>
<body>
<div id='content' style='width: 1115px; margin-left: auto; margin-right: auto'>
<div id='label'>
<center><h1 style='font-family:"Futura";font-weight:100; width: 800px; margin-left: auto; margin-right: auto'>Protovis Example</h1></center>
<center><h2 style='font-family:"Futura";font-weight:100; width: 800px; margin-left: auto; margin-right: auto'>Line Graph</h2> </center>
@maxogden
maxogden / datasets.js
Created Aug 8, 2010
portland oregon civicapps.org raw data urls
View datasets.js
"http://208.71.205.35/PITS",
"http://www.portlandonline.com/scripts/911incidents.cfm",
"http://www.portlandonline.com/scripts/911incidents-kml.cfm",
"ftp://ftp.oregonmetro.gov/odi/Addresses.zip",
"http://www.portlandonline.com/shared/file/data/address.zip",
"http://www.oregonexplorer.info/imagery/index.aspx",
"http://159.191.14.139/.docs/pg/10350",
"http://www.portlandonline.com/shared/file/data/Bicycle_Network_pdx.zip",
"http://www.portlandonline.com/shared/file/data/bicycle_parking_pdx.zip",
"http://www.portlandonline.com/shared/file/data/Bridges_pdx.zip",
You can’t perform that action at this time.