Skip to content

Instantly share code, notes, and snippets.

View max-mapper's full-sized avatar
🔰
✌( ͡ᵔ ͜ʖ ͡ᵔ )✌

Max max-mapper

🔰
✌( ͡ᵔ ͜ʖ ͡ᵔ )✌
View GitHub Profile
@max-mapper
max-mapper / gist:249877
Created December 5, 2009 21:53
lists images in a directory, returns javascript array
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) }
<!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;'>
@max-mapper
max-mapper / hash table in pure ruby
Created February 3, 2010 17:53
simple 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
@max-mapper
max-mapper / .bash_profile.sh
Created April 9, 2010 03:11
irbrc with textmate's sunburst colors and other fun enhancements
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
<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';
@max-mapper
max-mapper / instamapper_to_latitude.rb
Created May 20, 2010 16:52
gets data from instamapper and saves it to your google latitude account
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"
<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;
# 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.
#
<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>
@max-mapper
max-mapper / datasets.js
Created August 8, 2010 23:27
portland oregon civicapps.org raw data urls
"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",