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
# based off of http://wearehugh.com/public/2007/03/screenrc
# and http://diveintomark.org/archives/2007/03/15/good-easy-2007
# ~/.screenrc
# UTF-8 everywhere
defutf8 on
# disable Ctrl-S/Ctrl-Q "flow control"
scgi_local = /tmp/rpc.socket
#encoding_list = UTF-8
min_peers = 40
max_peers = 100
min_peers_seed = 10
max_peers_seed = 50
max_uploads = 15
upload_rate =50
directory =/home/torrents/torrents/doing
session = /home/torrents/.rtsession
"""
A helper for the app engine blobstore API and Django.
Works with the appengine patch:
http://code.google.com/p/app-engine-patch/
Taken and inspired by:
http://appengine-cookbook.appspot.com/recipe/blobstore-get_uploads-helper-function-for-django-request/
Usage:
#!/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
<?php
/*
Easy to use sms notifications from Notifo
Super quick hack by Harper - @harper - harper@nata2.org
First:
--------------
Get Google-Voice-PHP-API:
# 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`
@harperreed
harperreed / create_custom_origin.py
Created January 14, 2011 21:46
creates a custom origin for cloudfront. EASY CDN!
import boto
# requires cf_customorigin branch
# https://github.com/boto/boto/tree/cf_customorigin
origin_domain = 'www.example.org'
cdn_cname = ['media.example.org']
caller_reference = 'exmaple Distribution'
c = boto.connect_cloudfront()
d = c.create_custom_distribution(
@harperreed
harperreed / WBSAPI.php
Created February 1, 2011 04:52
Withings API php shell script for syncing to DB or whatever
<?
define ('pound',0.453592);
define ('inch', 0.0254);
function CurlCall ( $service , &$result=null )
{
try {
$s = curl_init();
curl_setopt($s,CURLOPT_URL,MYWBSAPIURL.$service);