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
DEPRECATION WARNING: @folder will no longer be implicitly assigned to folder. (called from check at /Users/brandon/Documents/git/macchiato/app/models/permission.rb:279) | |
DEBUG: check on line 279 of /Users/brandon/Documents/git/macchiato/app/models/permission.rb: | |
July 21, 2010 01:59 PM: object boolean: true and id: 4 and my_object_id: 2234023680 and my_class: ActiveSupport::Deprecation::DeprecatedObjectProxy | |
DEBUG: check on line 280 of /Users/brandon/Documents/git/macchiato/app/models/permission.rb: | |
July 21, 2010 01:59 PM: nil boolean: false and id: 4 and my_object_id: 4 and my_class: NilClass | |
DEBUG: check on line 282 of /Users/brandon/Documents/git/macchiato/app/models/permission.rb: | |
July 21, 2010 01:59 PM: ruby version: ruby-1.8.7-p174 | |
DEBUG: check on line 284 of /Users/brandon/Documents/git/macchiato/app/models/permission.rb: | |
July 21, 2010 01:59 PM: nil bytes: 0x4 | |
DEBUG: check on line 285 of /Users/brandon/Documents/git/macchiato/app/models/permission.rb: |
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
#include "ruby.h" | |
VALUE ValuePrinter = Qnil; | |
void Init_value_printer(); | |
VALUE method_inspect_bytes(VALUE object); | |
void Init_value_printer() { | |
ValuePrinter = rb_define_module("ValuePrinter"); | |
rb_define_method(ValuePrinter, "inspect_bytes", method_inspect_bytes, 0); |
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 dfs_order(vertex) | |
vertex.mark! | |
vertex.set_discover_time(@time += 1) | |
vertex.edges.each do |edge_vertex| | |
unless edge_vertex.visited? | |
edge_vertex.parent = vertex | |
dfs_order(edge_vertex) | |
end | |
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
# Balls! | |
class Ball | |
attr_accessor :x_pos, :y_pos, :x_speed, :y_speed | |
def initialize(x_pos, y_pos, x_speed, y_speed) | |
self.x_pos = x_pos | |
self.y_pos = y_pos | |
self.x_speed = x_speed | |
self.y_speed = y_speed |
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 Foo | |
def initialize | |
self.collection = [] | |
collection.extend Finder | |
end | |
end | |
module Finder | |
def [](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
function aspec { | |
args="" | |
for var in "$@" | |
do | |
args="$args spec/*/$var\_spec.rb app/*/$var.rb app/processors/$var.rb app/models/*/$var.rb spec/*/controls/$var\_spec.rb spec/models/*/$var\_spec.rb app/*/controls/$var.rb lib/$var.rb" | |
done | |
echo "Running autospec $args" | |
autospec $args | |
} |
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
foo, bar = nil, nil | |
begin | |
transaction do | |
foo = FooClass.create!(:blah => 'blah') | |
bar = BarClass.create!(:bleh => 'bleh') | |
return foo, bar, 'success' | |
end | |
rescue ActiveRecord::RecordInvalid => e |
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 aspec { | |
args="" | |
for var in "$@" | |
do | |
args="$args spec/*/$var\_spec.rb app/*/$var.rb app/processors/$var.rb app/models/*/$var.rb spec/*/controls/$var\_spec.rb spec/models/*/$var\_spec.rb app/*/controls/$var.rb lib/$var.rb" | |
done | |
echo "Running autospec $args" | |
autospec $args | |
} |
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 'autotest/fsevent' | |
require 'autotest/growl' | |
Autotest::Growl::remote_notification = true | |
Autotest.add_hook :initialize do |at| | |
at.sleep = 1 | |
%w{.svn .hg .git vendor}.each {|exception| at.add_exception(exception)} | |
unless ARGV.empty? |
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
table_for @discount_codes do |table| | |
table.column :code | |
table.column :description | |
table.column :max_uses, :label => 'Maximum Uses' do |discount_code| | |
discount_code.max_uses || 'Unlimited' | |
end | |
end | |
# I want to be able to do this: |