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
# Critical default settings: | |
disable_system_gems | |
disable_rubygems | |
bundle_path ".gems/bundler_gems" | |
# List gems to bundle here: | |
gem "rails", "3.0.pre", :git => "git://github.com/rails/rails.git" | |
gem "arel", :git => "git://github.com/rails/arel.git" | |
gem "i18n" | |
gem "dm-appengine" |
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
# Critical default settings: | |
disable_system_gems | |
disable_rubygems | |
bundle_path ".gems/bundler_gems" | |
# List gems to bundle here: | |
gem "rails", "3.0.pre", :git => "git://github.com/rails/rails.git" | |
gem "arel", :git => "git://github.com/rails/arel.git" | |
gem "i18n" | |
gem "dm-appengine" |
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
# Critical default settings: | |
disable_system_gems | |
disable_rubygems | |
bundle_path ".gems/bundler_gems" | |
# List gems to bundle here: | |
gem "rails", "3.0.pre", :git => "git://github.com/rails/rails.git" | |
gem "arel", :git => "git://github.com/rails/arel.git" | |
gem "i18n" | |
gem "dm-appengine" |
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 ruby | |
# -*- ruby -*- | |
require 'rubygems' | |
require 'daemon-spawn' | |
RAILS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')) | |
class DelayedJobWorker < DaemonSpawn::Base | |
def start(args) | |
ENV['RAILS_ENV'] ||= args.first || 'development' |
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
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
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
/* The following is a simple program to check for memory corrections in | |
* DRAM with ECC switched off. Accordingly to recend large scale studies | |
* such as http://www.cs.toronto.edu/~bianca/papers/sigmetrics09.pdf | |
* the error rate is of 25,000-75,000 errors per billion hours per Mbit. | |
* | |
* If this is true you should see at least one error after a few days | |
* running this program at max in a computer without ECC. | |
* | |
* Compile with: gcc -O2 -Wall -W -o dramerr dramerr.c | |
* |
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
# Run rake db:size to get a print of your database size in bytes. | |
# Run rake db:tables:size to get the sizes for individual tables | |
# Works for MySQL and PostgreSQL. Not tested elsewhere. | |
namespace :db do | |
desc 'Print data size for entire database' | |
task :size => :environment do | |
database_name = ActiveRecord::Base.connection.instance_variable_get("@config")[:database] | |
adapter = ActiveRecord::Base.connection.adapter_name.downcase |
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
# Newbie Programmer | |
def factorial(x) | |
if x == 0 | |
return 1 | |
else | |
return x * factorial(x - 1) | |
end | |
end | |
puts factorial(6) | |
puts factorial(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
# Blog post at | |
# http://pivotallabs.com/users/rolson/blog/articles/1162-redefine-a-method-from-a-module-like-a-gentleman | |
module Teacher | |
def self.included(base) | |
base.extend ClassMethods | |
base.overwrite_initialize | |
base.instance_eval do | |
def method_added(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
module ParameterizedConcern | |
def extended(mod = nil, &block) | |
unless mod | |
@extended_block = block | |
return | |
end | |
mod.module_eval(&@extended_block) if @extended_block | |
end |
OlderNewer