Skip to content

Instantly share code, notes, and snippets.

View harperreed's full-sized avatar

Harper Reed harperreed

View GitHub Profile
:⌉
=⌉
¦-) 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 / mdp
Created March 29, 2011 03:52
markdown preview (for osx)
#!/bin/bash
#
# Displays a preview of the markdown file passed in using rdiscount
# https://github.com/ryankanno/scripts/blob/master/mdp
# Set Markdown file
MARKDOWN_FILE=$1
# Redirect rdiscount to temp file
rdiscount ${MARKDOWN_FILE} > /tmp/mdp_preview.html
@harperreed
harperreed / authors.sh
Created April 4, 2011 04:00
A simple bundle of scripts to migrate from svn to git for instance: your repo path is: /trunk/app/vendors/ you would do: sh strip_svn.sh svn.dump trunk/app/vendors vendors.dump this would create a dump file called vendors that is just the comm
#!/usr/bin/env bash
authors=$(svn log -q | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq)
for author in ${authors}; do
echo "${author} = NAME <USER@DOMAIN>";
done
@harperreed
harperreed / fix_appengine_permissions.sh
Created April 10, 2011 05:18
fix appengine dir permissions after upgrading
sudo chmod 755 -R /usr/local/google_appengine
Harper@nata2.org's Geekcode
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d--- s+:-- a-- C++++ UL++++ P++ W+++ N+ PS+++ PE+ Y++ PGP !tv b++++
e++ h r++ z?
------END GEEK CODE BLOCK------
@harperreed
harperreed / mem_use_by_process.sh
Created May 10, 2011 20:07
show memory usage by process
ps aux | awk '{print $4"\t"$11}' | sort | uniq -c | awk '{print $2" "$1" "$3}' | sort -nr
@harperreed
harperreed / migrate_gh.sh
Created October 23, 2011 06:02
Migrate to bitbucket from github and svn (springloops)
base_dir=$(pwd)
repo_name=$1
old_git_url="git@github.com:harperreed/$repo_name.git"
git_url="git@bitbucket.org:harper/$repo_name.git"
git clone $old_git_url
cd $repo_name
git remote rm origin
git remote add origin $git_url
git push origin master
@harperreed
harperreed / git_inotify-commit.sh
Created January 9, 2012 21:43
git_inotify-commit.sh
#!/bin/sh
# Originally by Bjoern Steinbrink, simplified by Johannes Schindelin
# http://git.661346.n2.nabble.com/inotify-commit-was-Re-git-guidance-td3534419.html
inotifywait -m -r --exclude ^\./\.git/.* \
-e close_write -e move -e create -e delete . 2>/dev/null |
while read FILE_PATH EVENT FILE_NAME
do
FILE_NAME="$FILE_PATH$FILE_NAME"