This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# twitdiff.rb | |
# Quickie script for unfollowing users who aren't following you, | |
# or following users who are following you...or both | |
# Requires Grackle (http://github.com/hayesdavis/grackle/tree/master): | |
# sudo gem sources -a http://gems.github.com | |
# sudo gem install hayesdavis-grackle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> ("0".."10").to_a | |
=> ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"] | |
>> ("1".."10").to_a | |
=> ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"] | |
>> ("2".."10").to_a | |
=> [] | |
>> ("2".."9").to_a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -f image2 -r 24 -i ./frames/code_swarm-%05d.png -sameq out.mov -pass 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open-uri' | |
content = nil | |
puts "Valid cert:" | |
open("https://www.wesabe.com") { |s| content = s.read } | |
puts " got #{content.length} bytes" | |
puts "Invalid cert: " | |
open("https://google.com") { |s| content = s.read } | |
puts " got #{content.length} bytes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# reminder to do pushups every hour while at work | |
45 9-17 * * 1-5 /usr/local/bin/growlnotify -m "pushups" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Taking on the Binary Search challenge | |
# http://reprog.wordpress.com/2010/04/19/are-you-one-of-the-10-percent/ | |
class Array | |
# Binary search; assumes array is sorted | |
# If value is found in the array, it returns an index where it can be found. | |
# If the value occurs multiple times in the array, it will just return the | |
# first place it is found (not necessarily the first occurrence in the array). | |
# If the value is not found, it returns nil. | |
def bsearch(value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# port you have open on your home router to forward ssh | |
SSH_PORT=22022 | |
# set up dynamic dns if you don't have a static ip | |
HOST=your.home.ip | |
# OSX Screen Sharing will complain if you try to connect to the standard | |
# VNC ports (5900+) on localhost, so pick another available port | |
LOCAL_PORT=1202 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Pop up a reminder at given time (or a given amount of time from now) | |
# | |
# Usage: | |
# remindme "Go home" 5pm | |
# remindme "Move the car" +2 hours | |
# remindme "Call Bob" tomorrow | |
# | |
# For more on possible time formats, 'man at' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install ruby 1.9.2 on OS X | |
rvm package install readline | |
rvm package install iconv | |
rvm install 1.9.2 -C --enable-shared,--with-iconv-dir=$HOME/.rvm/usr,--with-readline-dir=$HOME/.rvm/usr,--build=x86_64-apple-darwin10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Xcode Auto-Versioning | |
# | |
# Updates your Info.plist's CFBundleVersion with the current git tag and/or sha. | |
# | |
# based on https://github.com/elliottcable/xcode-git-versioner | |
# | |
# Usage: | |
# 1. Right-click the target you want to add the versioning phase to (usually the target that builds your app) | |
# 2. Select: Add -> New Build Phase -> New Run Script Build Phase | |
# 3. Specify /usr/bin/env ruby as the shell for the script |