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
desc "Rebuild localhosts" | |
task(:rebuild_localhosts => :environment) do | |
ClientDomain.rebuild_localhosts | |
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
*.swp | |
.swo | |
*.scratch.* | |
log/*.log | |
log/searchd.* | |
tmp/**/* | |
db/*.db | |
db/*.sqlite3 | |
.DS_Store | |
doc/api |
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
*.swp | |
.swo | |
jferris-*.gemspec | |
*.scratch.* | |
log/*.log | |
log/searchd.* | |
tmp/**/* | |
db/*.db | |
db/*.sqlite3 | |
.DS_Store |
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
before do | |
if request.host != 'foo.com' | |
redirect 'http://foo.com' | |
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
require 'open-uri' | |
def blow_my_money(bet) | |
spin = open("http://roulette.engineyard.com").read.split(":")[1][/"\d+"/].to_i | |
payout = spin == 13 ? bet*35 : 0 | |
"%.2f" % payout | |
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
require 'rubygems' | |
require 'bacon' | |
describe 'A new array' do | |
before do | |
@ary = (1..10).to_a | |
end | |
it 'should not be empty' do | |
@ary.length.should.be > 1 |
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 Rack | |
class Konami | |
KONAMI_CODE = <<-EOTC | |
<div id="rack_konami" style="display:none;position:fixed;top:20%;right:50%;"> | |
{{HTML}} | |
</div> | |
<script type="text/javascript"> | |
var Konami=function(){var a={addEvent:function(b,c,d,e){if(b.addEventListener)b.addEventListener(c,d,false);else if(b.attachEvent){b["e"+c+d]=d;b[c+d]=function(){b["e"+c+d](window.event,e)};b.attachEvent("on"+c,b[c+d])}},input:"",pattern:"3838404037393739666513",load:function(b){this.addEvent(document,"keydown",function(c,d){if(d)a=d;a.input+=c?c.keyCode:event.keyCode;if(a.input.length>a.pattern.length)a.input=a.input.substr(a.input.length-a.pattern.length);if(a.input==a.pattern){a.code(b);a.input= | |
""}},this);this.iphone.load(b)},code:function(b){window.location=b},iphone:{start_x:0,start_y:0,stop_x:0,stop_y:0,tap:false,capture:false,orig_keys:"",keys:["UP","UP","DOWN","DOWN","LEFT","RIGHT","LEFT","RIGHT","TAP","TAP","TAP"],code:function(b){a.code(b)},load:function(b){orig_keys=this.keys;a.addEvent(do |
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
User.all(:conditions => { :birthday => (Time.now.midnight - 1.day)..(Time.now.midnight + 1.month}, :active => true) |
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 signup | |
user = User.new(blah blah blah) | |
begin | |
UserMailer.email_confirmation(user).deliver | |
rescue Exception => e | |
handle error | |
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
module Rack | |
class Clicky | |
TRACKING_CODE = <<-EOTC | |
<script src="http://static.getclicky.com/js" type="text/javascript"></script> | |
<script type="text/javascript">clicky.init({{CODE}});</script> | |
<noscript><p><img alt="Clicky" width="1" height="1" src="http://in.getclicky.com/{{CODE}}ns.gif" /></p></noscript> | |
EOTC | |
def initialize(app, site_id, options = {}) |