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 | |
while : | |
do | |
echo "Checking for iOS 5: `date`" | |
result=`curl -s -L http://phobos.apple.com/version | grep Restore | grep iPhone | grep 5.0` | |
if [ -z "$result" ]; then | |
echo "Nothing yet..." | |
else | |
say "I O S 5 IS NOW AVAILABLE. GO GET YOUR DOWNLOAD ON, KID" | |
fi |
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 macruby | |
abort "Usage: #{__FILE__} [image]" if ARGV.empty? | |
framework "Cocoa" | |
wallpaper_path = File.expand_path(ARGV.first) | |
wallpaper_url = NSURL.fileURLWithPath(wallpaper_path, isDirectory: false) | |
workspace = NSWorkspace.sharedWorkspace |
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
def online_users(since = 5) | |
sessions = ActiveRecord::SessionStore::Session.where("updated_at >= ?", since.minutes.ago) | |
user_ids = sessions.all.map { |session| session.data["user_id"] } | |
User.where(:id => user_ids) | |
end |
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
<?php | |
foreach ($images as $index => $image) { | |
if ($index % 3 == 0) { | |
echo "<div class='yox_row'>"; | |
} | |
echo "<div class='yox_cell'>"; | |
echo get_resource_link($image); | |
echo "</div>"; |
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
Pledgee.where(:email_me => true).each do |pledgee| | |
if [1.week, 3.weeks, 6.weeks].include? pledgee.days_since_pledge | |
PledgeeMailer.reminder_email(pledgee).deliver | |
end | |
end |
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
NoMethodError: undefined method `_run_before_destroy_callbacks' |
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
- f.semantic_fields_for :contributions, obj, :child_index => i do |child_form| | |
= child_form.input :person_id, :collection => Person.all.collect { |p| [p.name, p.id]}, :include_blank => false, :label => 'Contributor Name' | |
= child_form.input :name, :label => 'Type' |
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
(function($) { | |
var thisIsPrivate = function(number) { | |
console.log("this can only be called from inside this scope", number); | |
} | |
var soIsThis = 4; | |
$.Model.extend('MyModel', | |
/* static */ | |
{ |
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
==> Build Environment | |
CC: /usr/bin/cc => /usr/bin/gcc-4.2 | |
CXX: /usr/bin/c++ => /usr/bin/c++-4.2 | |
LD: /usr/bin/cc => /usr/bin/gcc-4.2 | |
CFLAGS: -O3 -march=core2 -msse4.1 -w -pipe | |
CXXFLAGS: -O3 -march=core2 -msse4.1 -w -pipe | |
MAKEFLAGS: -j2 | |
==> Downloading http://kernel.org/pub/software/scm/git/git-1.7.2.1.tar.bz2 | |
File already downloaded and cached to /Users/jerod/Library/Caches/Homebrew | |
/usr/bin/tar xf /Users/jerod/Library/Caches/Homebrew/git-1.7.2.1.tar.bz2 |
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
def self.find_with_destroyed *args | |
self.with_exclusive_scope { find(*args) } | |
end | |
def destroy | |
return false if callback(:before_destroy) == false | |
self.deleted_at = current_time_from_proper_timezone | |
result = update_without_callbacks | |
callback(:after_destroy) | |
result |