This file contains hidden or 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
<html> | |
<head> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script> | |
<script type="text/javascript"> | |
// file://localhost/Users/skattyadz/code/audio/index.htm?boo1=157217&boo2=3113 | |
$(document).ready(function(){ | |
var audio1 = document.createElement('audio'); | |
var audio2 = document.createElement('audio'); | |
audio1.volume=0.5; |
This file contains hidden or 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
class Object | |
def method_missing(method, *args, &block) | |
if (m = method.to_s).ends_with? '?' | |
!!send(m.chop, *args, &block) | |
else | |
super | |
end | |
end | |
end |
This file contains hidden or 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
# rails runner lib/mail_generator.rb | |
OUTPUT_DIR = 'mail_examples' | |
`rm -rf #{OUTPUT_DIR}/` | |
`mkdir #{OUTPUT_DIR}/` | |
@methods = UserMailer.instance_methods(false).map(&:to_sym) | |
def generate(method, *params) | |
mail = UserMailer.send(method, *params) | |
This file contains hidden or 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
# script/runner lib/get_twitter_user_ids.rb | |
class ErrorFourOhOne < Exception; end | |
class ThreadWorker < Thread | |
def initialize(twitter_auths, ids) | |
@ids = ids | |
@twitter_auths = twitter_auths | |
super do | |
get_id_for(@twitter_auths.pop) while twitter_auths.present? |
This file contains hidden or 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
- Arts: | |
- Design | |
- Fashion & Beauty | |
- Food | |
- Literature | |
- Performing Arts | |
- Spoken Word | |
- Visual Arts | |
- Business: | |
- Business News |
This file contains hidden or 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
module ActiveRecord | |
class Base | |
def self.random(conditions = nil) | |
c = count(:conditions=>conditions) | |
unless c == 0 | |
first(:conditions=>conditions, :offset =>rand(c)) | |
end | |
end | |
end | |
end |
NewerOlder