Skip to content

Instantly share code, notes, and snippets.

View nummi's full-sized avatar
😺
Working from home

Jerry Nummi nummi

😺
Working from home
View GitHub Profile
@nummi
nummi / Testing
Created September 10, 2008 20:17
var test = {
init: function() {
$('#test').show();
}
};
function cd() { builtin cd $1 && ls }
function pman() { man -t "${1}" | open -f -a /Applications/Preview.app }
function preview() { open -a Preview $* }
# Force 'sudo zsh' to start root as a loging shell to
# avoid problems with environment clashes
function sudo() {
if [[ $1 = "zsh" ]]; then
/**
IMPORTANT: Requires this version of jquery
until 1.3.3 comes out http://gist.github.com/186325
ALSO: This is very dirty still and has not been
abstracted for use. It is just solving our immediate problems.
Use cases that must pass (and should be tested someday):
* Clicking on links updates layout
* Click around a bit and then use back/forward buttons
/**
IMPORTANT: Requires this version of jquery
until 1.3.3 comes out http://gist.github.com/186325
ALSO: This is very dirty still and has not been
abstracted for use. It is just solving our immediate problems.
Use cases that must pass (and should be tested someday):
* Clicking on links updates layout
* Click around a bit and then use back/forward buttons
require 'rubygems'
require 'rake'
task :extract do
extract_photos
end
namespace :extract do
task :test do
extract_photos(true)
require 'time'
loop do
if Time.now > Time.parse('06:30')
`/usr/bin/open "/Users/ryanbriones/Music/iTunes/iTunes Music/Daft Punk/Discovery/01 One More Time.mp3"`
break
end
puts "#{Time.now} not #{Time.parse('06:30')}"
sleep 5
String.class_eval do
def create_links
self.gsub(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/, '<a href="\1" rel="external">\1</a>')
end
end
$('a[rel=external]').click(function() {
var newWindow = window.open($(this).attr('href'), '_blank');
if(newWindow) { if(newWindow.focus) { newWindow.focus(); return false; } }
newWindow = null;
});
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"rimshot" ofType:@"aif"];
NSError* err;
AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL URLWithString:filePath] error:&err];
-(void) playSound:(NSString *)fileName {
NSString *filePath = [[NSBundle mainBundle] pathForResource:fileName ofType:@"aif"];
NSError* err;
AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:filePath] error:&err];
player.delegate = self;
[player play];
}