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
class Metadata < ActiveRecord::Base | |
set_table_name "meta_metadata" | |
belongs_to :meta_object, :polymorphic => true | |
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
function __autoload( $sClass ) | |
{ | |
// Your own autoload code goes here | |
// Failed to load, try Kohana's autoloader | |
// Bootstrap it first | |
if ( !defined('SYSPATH') ) | |
{ | |
define('SYSPATH', ROOT.'kohana/system/'); | |
define('APPPATH', ROOT.'kohana/application/'); | |
define('EXT', '.php'); |
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
# Delete unnecessary files | |
run "rm public/index.html" | |
run "rm public/favicon.ico" | |
run "rm public/javascripts/prototype.js" | |
run "rm public/javascripts/effects.js" | |
run "rm public/javascripts/dragdrop.js" | |
run "rm public/javascripts/controls.js" | |
# Copy database.yml for distribution use | |
run "cp config/database.yml config/database.yml.example" |
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 | |
name=$1 | |
if [ -z "$name" ] ; then | |
echo "need to give name of checkout dir on command line" | |
exit 1 | |
fi | |
dir="~/rails_apps/$name" | |
if [ ! -d $dir ] ; then | |
echo "the directory $dir does not exist" |
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 'rubygems';require 'active_support';require 'nokogiri';puts Nokogiri.HTML(ActiveSupport::JSON.decode(`curl -s -F url=#{ARGV.first} http://hurl.r09.railsrumble.com/`)['body']).content |
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/local/bin/ruby | |
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
doc = Nokogiri.XML(open('http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=boffbowsh&api_key=b25b959554ed76058ac220b7b2e0a026').read) | |
puts "Now Playing: #{doc.css('track[nowplaying=true] artist')[0].content} - #{doc.css('track[nowplaying=true] name')[0].content}" |
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
diff --git a/config/deploy.rb b/config/deploy.rb | |
index b5ad582..bdb8592 100644 | |
--- a/config/deploy.rb | |
+++ b/config/deploy.rb | |
@@ -16,10 +16,6 @@ set :deploy_via, :remote_cache | |
set :repository, "[email protected]:rawnet/lastpercent.git" | |
set :scm, :git | |
-on :start do | |
- `ssh-add` |
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
// Make 'this' available within ajax calls | |
Function.prototype.bind = function(thisArg){ | |
var self = this; | |
return function() { self.apply(thisArg, arguments); }; | |
}; |
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
class ProductPage < ActiveRecord::Base | |
has_many :text, :class_name => 'ProductPageContent' do | |
def [] name | |
name = name.to_s | |
find_by_field_name(name).body | |
end | |
def []= name, body | |
name = name.to_s | |
contents = find_or_initialize_by_field_name name |
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
/Users/boffbowsh/code/ruby/rubinius/spec/frozen/core/kernel/require_spec.rb | |
Kernel#require | |
- is a private method | |
- resolves paths relative to the current working directory | |
- does not expand/resolve qualified files against $LOAD_PATH | |
- loads a .rb from an absolute path | |
- collapses consecutive path separators | |
- loads an unqualified .rb by looking in $LOAD_PATH and returning true | |
- allows unqualified files to contain path information (just not in the beginning) | |
- loads a file with ./filename even if . is not in path |
OlderNewer