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
main.rb | |
--------------------------------------------- | |
get '/' do | |
raise "explode!" | |
end | |
mailexceptions.rb | |
--------------------------------------------- | |
def call(env) | |
status, headers, body = |
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 ProjectReader | |
extend self # keep extract_keys 'module private' | |
# finds keys in .erb files from a given directory | |
def find_keys(path) | |
repo_name = File.basename(path) | |
if !File.directory?(path) | |
raise "The directory #{repo_name} does not exist in #{File.dirname(path)}" | |
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
[2010-09-28 21:58:31] make | |
eval.c: In function ‘ruby_cleanup’: | |
eval.c:139: warning: passing argument 1 of ‘ruby_init_stack’ discards qualifiers from pointer target type | |
./include/ruby/ruby.h:1001: note: expected ‘VALUE *’ but argument is of type ‘volatile VALUE *’ | |
io.c: In function ‘argf_next_argv’: | |
io.c:6241: warning: ignoring return value of ‘fchown’, declared with attribute warn_unused_result | |
process.c: In function ‘rb_fork’: | |
process.c:2322: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result | |
process.c: In function ‘proc_daemon’: | |
process.c:4239: warning: ignoring return value of ‘chdir’, declared with attribute warn_unused_result |
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 email_to_friend | |
errors = [] | |
@name = params['email-to-friend']['name'] | |
if @name == '' | |
errors << "Name is missing" | |
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
app/model/event.rb | |
class MediaDatabase::Event < External | |
establish_connection :media_development | |
end | |
external.rb - not sure where it should be | |
class External < ActiveRecord::Base |
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
~/misc/projects/github/spree/sandbox$ rails g spree:install | |
/home/oren/.rvm/gems/ruby-1.9.2-p0@spree/gems/mysql2-0.2.4/lib/mysql2/client.rb:36:in `connect': can't convert Fixnum into String (TypeError) | |
from /home/oren/.rvm/gems/ruby-1.9.2-p0@spree/gems/mysql2-0.2.4/lib/mysql2/client.rb:36:in `initialize' | |
from /home/oren/.rvm/gems/ruby-1.9.2-p0@spree/gems/mysql2-0.2.4/lib/active_record/connection_adapters/mysql2_adapter.rb:14:in `new' | |
from /home/oren/.rvm/gems/ruby-1.9.2-p0@spree/gems/mysql2-0.2.4/lib/active_record/connection_adapters/mysql2_adapter.rb:14:in `mysql2_connection' | |
from /home/oren/.rvm/gems/ruby-1.9.2-p0@spree/gems/activerecord-3.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `new_connection' | |
from /home/oren/.rvm/gems/ruby-1.9.2-p0@spree/gems/activerecord-3.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:238:in `checkout_new_connection' | |
from /home/oren/.rvm/gems/ruby-1.9.2-p0@spree/gems/activerecord-3.0.0/lib/active_record/connection_adapt |
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 'sinatra' | |
app_file = File.join(File.dirname(__FILE__), *%w[.. .. reports.rb]) | |
require app_file | |
# Force the application name because polyglot breaks the auto-detection logic. | |
Sinatra::Application.app_file = app_file | |
require 'spec/expectations' | |
set :environment, :test |
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
# See http://wiki.github.com/aslakhellesoy/cucumber/sinatra | |
# for more details about Sinatra with Cucumber | |
require 'sinatra' | |
app_file = File.join(File.dirname(__FILE__), *%w[.. .. reports.rb]) | |
require app_file | |
# Force the application name because polyglot breaks the auto-detection logic. | |
Sinatra::Application.app_file = app_file | |
require 'spec/expectations' |
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
start report "New users on the last 7 days" period "every 11AM" emails "ogolan@borderstylo.com" | |
display LineChart | |
sum of created | |
from user_created | |
between 1 week ago and now | |
in days | |
display PieChart | |
sum of created | |
from user_created |
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
how to remove a class from the kids? | |
$('.tree > ul > li').click(function(event){ | |
$('.tree ul li').removeClass("selected"); | |
$(this).addClass("selected"); | |
$(this).find("ul > li").removeClass("selected"); | |
}); | |
<div class='tree'> |