Skip to content

Instantly share code, notes, and snippets.

View aerickson's full-sized avatar

Andrew Erickson aerickson

View GitHub Profile
@aerickson
aerickson / keybase.md
Created April 4, 2015 03:55
keybase.md

Keybase proof

I hereby claim:

  • I am aerickson on github.
  • I am aerickson (https://keybase.io/aerickson) on keybase.
  • I have a public key whose fingerprint is 6DE6 51F5 A324 882E AB32 A9E8 DE79 F47A 9C1F 0CA6

To claim this, I am signing this object:

require 'rubygems'
require 'grit'
require 'active_support'
include Grit
#
# USAGE: dead_branches <path_to_repo>
#
<html>
<head>
<title>Image</title>
<script type="text/javascript">
function resizeImage()
{
var window_height = document.body.clientHeight
var window_width = document.body.clientWidth
@aerickson
aerickson / unix rename files
Created March 9, 2011 05:47
easier than dealing with sed (for me at least)
for f in *.MP3; do mv "$f" "`basename "$f" .MP3`.mp3"; done;
#!/bin/bash
FAIL=0
echo "starting"
./sleeper 2 0 &
./sleeper 2 1 &
./sleeper 3 0 &
./sleeper 2 0 &
@aerickson
aerickson / bootstrap_3_with_typeahead_js_working.html
Last active October 2, 2015 20:56
Example showing Bootstrap 3.0.0 and Typeahead.js 0.9.3 working. From http://www.bootply.com/86571# (but with fixed css/js links).
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>Bootply snippet - Bootstrap 3 Typeahead</title>
<meta name="generator" content="Bootply" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="A search typeahead example for Bootstrap 3" />
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
@aerickson
aerickson / gist:4b40a16b824e5891d237
Last active October 2, 2015 21:26
Bootstrap 3.0.0 and Typeahead.js 0.11.1/Latest working example. From http://jsfiddle.net/KrtB5/340/.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> - jsFiddle demo</title>
<script type='text/javascript' src='//code.jquery.com/jquery-2.0.2.js'></script>
@aerickson
aerickson / gist:1111135
Created July 28, 2011 07:10
making sudo work on lion
from: http://forums.macrumors.com/showthread.php?t=447812
///////////////
Reboot into single user mode (hold Option S while booting until it switches to text mode)
At the single user prompt, type: /sbin/fsck -fy
This checks the filesystem integrity
require 'rubygems'
require 'mechanize'
FIRST_NAME = 'FIRST_NAME'
LAST_NAME = 'LAST_NAME'
PHONE = 'PHONE'
EMAIL = 'EMAIL@provider.com'
PARTY_SIZE = 2
SCHEDULE_RANGE = { :start_time => '19:00', :end_time => '20:30' }
@aerickson
aerickson / find_external_ip.rb
Created September 16, 2013 18:20
Get your IP address on unix-y system without a fork in Ruby. http://coderrr.wordpress.com/2008/05/28/get-your-local-ip-address/
require 'socket'
def local_ip
orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true # turn off reverse DNS resolution temporarily
UDPSocket.open do |s|
s.connect '64.233.187.99', 1
s.addr.last
end
ensure