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
gem 'resque', '>= 1.10.0' | |
gem 'heroku' # You will need the heroku gem for this too. |
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 app; | |
worker_processes 2; | |
error_log /home/app/logs/nginx.error.log info; | |
events { | |
worker_connections 1024; | |
} | |
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 Dragonfly | |
module Endpoint | |
def success_headers(job) | |
{ | |
"Content-Type" => job.app.resolve_mime_type(job.result), | |
"Content-Length" => job.size.to_s, | |
"Content-Disposition" => "filename=#{job.name}" | |
}.merge(cache_headers(job)) | |
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
## | |
# With regular RSpec stubbing | |
it 'should allow JPG images' do | |
photo = Photo.new :photo => fixture_file_upload('photos/chameleon.jpg', 'image/jpeg') | |
photo.stub!(:save_attached_files).and_return true | |
photo.save.should be_true | |
end | |
## | |
# With Mocha on "any" instance of a Class |
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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: mongodb | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the mongodb data-store | |
# Description: starts mongodb using start-stop-daemon |
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
# index.html.erb | |
<ul id="projects"> | |
<% @projects.each_with_index do |project, index| %> | |
<% content_tag_for :li, project do %> | |
<%= project.name %> | |
<%= button_to('up', :action => 'sort', :projects => @projects.swap(index, index -1)) if index > 0 %> | |
<%= button_to('down', :action => 'sort', :projects => @projects.swap(index, index +1)) if index < @projects.length - 1 %> | |
<% end %> | |
<% end %> |
NewerOlder