Discover gists
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
/home/cag/cag/current/public/dispatch.cgi:10ndor/rails/railties/lib/dispatcher.rb:41:in `dispatch'0:in `process'4:in `sass_old_process'gement_support' |
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
wtf | |
what's wrong? |
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
load 'config/dns' | |
set :ip, '127.0.0.1' | |
set :domains, %w(example.net. example.com. example.org.) |
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
ss |
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 children(options = {}) | |
options.merge!({ :order => 'updated_at desc' }) | |
options # => {:limit=>3, :order=>"updated_at desc"} | |
found = articles.find(:all, options) | |
options # => {:conditions=>"`articles`.section_id = 2", :readonly=>nil, :select=>nil, :group=>nil, :offset=>nil, :limit=>3, :include=>:_route, :joins=>nil, :order=>"updated_at desc, created_at desc"} | |
found += pages.find(:all, options) | |
found.sort! { |x, y| y.updated_at <=> x.updated_at } | |
options[:limit] ? found[0, options[:limit]] : found | |
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
module ApplicationHelper | |
def e_tag(model) | |
eval("link_to image_tag(\'pencil.png\'), edit_#{model.class.name.underscore}_path(model)") | |
end | |
def d_tag(model) | |
eval("link_to image_tag(\'delete.png\'), model, :confirm => \'Are you sure?\', :method => :delete") | |
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
module ApplicationHelper | |
def e_tag(model) | |
eval("link_to image_tag(\'pencil.png\'), edit_#{model.class.name.underscore}_path(model)") | |
end | |
def d_tag(model) | |
eval("link_to image_tag(\'delete.png\'), model, :confirm => \'Are you sure?\', :method => :delete") | |
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
/* It's a 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
# this is cool | |
puts "very freaking cool." |
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 logistic(x, mu = 9): | |
'Smoothing function (s curve).' | |
return 1 - 1 /( 1 + math_e ** ((x - 1/2) * mu)) |