Skip to content

Instantly share code, notes, and snippets.

View harperreed's full-sized avatar

Harper Reed harperreed

View GitHub Profile

#Web product guidelines

From @leahculver. Originally posted here.

  • simple
  • public over private
  • personal vanity
  • internet is global
  • permalinks
  • one important item per page
  • don't break the browser
#!/usr/bin/env ruby
# Input: WordPress XML export file.
# Outputs: a series of Textile files ready to be included in a Jekyll site,
# and comments.yml which contains all approved comments with metadata which
# can be used for a Disqus import.
require 'rubygems'
require 'hpricot'
require 'clothred'
:⌉
=⌉
¦-) as opposed to |
⍥ om nom nom
# needs http://jocr.sourceforge.net/
# sudo port install gocr
#
#!/usr/bin/env ruby
require 'rubygems'
require 'open-uri'
require 'nokogiri'
doc = Nokogiri::HTML(open("http://cidlookup.com/lookup/#{ARGV[0].gsub("-","")}/"))
image_url = "http://cidlookup.com" + doc.css("#content .gt img").first.attributes["src"]
caller_name = `curl #{image_url} > name.png 2> /dev/null && gocr name.png`
#!/usr/bin/env python
"""
A script to query the Amazon Web Services usage reports programmatically.
Ideally this wouldn't exist, and Amazon would provide an API we can use
instead, but hey - that's life.
Basically takes your AWS account username and password, logs into the
website as you, and grabs the data out. Always gets the 'All Usage Types'
@harperreed
harperreed / aws_usage.py
Created September 12, 2011 19:29 — forked from noneal/aws_usage.py
A script to query the Amazon Web Services (S3/EC2/etc) usage reports programmatically.
#!/usr/bin/env python
"""
A script to query the Amazon Web Services usage reports programmatically.
Ideally this wouldn't exist, and Amazon would provide an API we can use
instead, but hey - that's life.
Basically takes your AWS account username and password, logs into the
website as you, and grabs the data out. Always gets the 'All Usage Types'
require 'github_v3_api'
g = g=GitHubV3API.new(ENV['GITHUB_OAUTH2_TOKEN'])
cfa = g.orgs.list.first
names = cfa.repos.map(&:name)
names.each do |name|
hooks = g.get("/repos/codeforamerica/#{name}/hooks")
scream_hook = hooks.find {|h| h["name"] == "web" && h["config"]["url"] =~ /6178/}
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 10/13/2011
####################################
sudo apt-get update
sudo apt-get upgrade
@harperreed
harperreed / gist:1756940
Created February 7, 2012 03:25 — forked from obsesh/gist:1738514
2012 updated sxsw scrapper
import urllib, mechanize
import time
import simplejson
import os
import sys
from multiprocessing import Pool
import pickle
@harperreed
harperreed / scrapple.py
Last active December 25, 2015 07:39 — forked from jhofman/scrapple.py
updated to check all models in a specific zip
#!/usr/bin/env python
#
# file: scrapple.py
#
# description: checks apple.come for iphone 5s in-store pickup availability
#
# usage: ./scrapple.py [zip]
#
# or in a crontab:
# */5 * * * * /path/to/scrapple.py 10012 && mailx -s 5s [email protected]