Skip to content

Instantly share code, notes, and snippets.

Avatar
🔥

Andrew Sullivan sllvn

🔥
View GitHub Profile
View gist:9028033
{
"location": {
"id": 1,
"city": "Seattle",
"state": "WA",
"coordinates": {
"lat": 47.603569,
"lng": -122.329453
},
"slug": "seattle",
View Record from 2012-09-18
Domain Name: GLASSHELL.COM
Registrant:
PrivacyProtect.org
Domain Admin (contact@privacyprotect.org)
ID#10760, PO Box 16
Note - All Postal Mails Rejected, visit Privacyprotect.org
Nobby Beach
null,QLD 4218
AU
@sllvn
sllvn / record-stores.geojson
Last active Aug 29, 2015
Seattle Record Stores
View record-stores.geojson
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:2152742
class ZombiesController < ApplicationController
before_filter :find_zombie
def show
render :action => :show
end
def find_zombie
@zombie = Zombie.find params[:id]
if @zombie.tweets.size == 0
View gist:2188969
# Disable Resume system-wide
defaults write NSGlobalDomain NSQuitAlwaysKeepsWindows -bool false
# Disable the “reopen windows when logging back in” option
# This works, although the checkbox will still appear to be checked.
defaults write com.apple.loginwindow TALLogoutSavesState -bool false
defaults write com.apple.loginwindow LoginwindowLaunchesRelaunchApps -bool false
via https://github.com/mathiasbynens/dotfiles/blob/master/.osx
@sllvn
sllvn / tally.rb
Created Apr 14, 2012
Verite Spotify contest vote tallier
View tally.rb
#!/usr/bin/env ruby
# CSV file available at: http://dl.dropbox.com/u/24209319/Verite%20Spotify%20Playlist%20Voting-%20Foreign%20Languages.csv
require 'csv'
class Tally < Hash
def vote(key, x)
self[key] = 0 unless self[key]
self[key] += x
@sllvn
sllvn / gist:2554014
Created Apr 29, 2012
Create a hash with keys set in array
View gist:2554014
keys = %w[event event_id event_type name description date]
Hash[*keys.map { |v| [v.to_sym, nil] }.flatten]
View gist:2865923
octave:1> A = [1 2; 3 4]
A =
1 2
3 4
octave:2> A - mean(A)
warning: operator -: automatic broadcasting operation applied
ans =
View gist:2896614
<Placemark>
<name>North America</name>
<description>North America is a continent in the northern hemisphere, bounded on the north by the Arctic Ocean, on the ea
A change: Both North and South America are named after Amerigo Vespucci, who was the first European to suggest that the Americas were not the E
North America occupies the northern portion of the landmass generally referred to as the New World, the Western Hemisphere, the Ameri
<LookAt>
<longitude>-92.38030591736968</longitude>
<latitude>41.60040029662516</latitude>
View knight-random-walk.rb
#!/usr/bin/env ruby
class Knight
attr_accessor :x, :y, :count
def initialize(x, y)
@x, @y, @count = x, y, 0
end
def position