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 File.expand_path('../config/application', __FILE__) | |
require 'rake' | |
require 'resque/tasks' | |
Feedtopic::Application.load_tasks |
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 | |
ln -s supervisord.conf_$(hostname) supervisord.conf |
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
[program:scheduler] | |
command = rake resque:scheduler | |
environment = QUEUE=* | |
directory = /home/dotcloud/current/ |
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
[program:resque] | |
command = rake resque:work | |
environment = QUEUE=*,RAILS_ENV=production | |
directory = /home/dotcloud/current/ |
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
production: | |
adapter: postgresql | |
encoding: unicode | |
database: feedtopic | |
pool: 5 | |
username: x | |
password: "some|password" | |
port: 1200 | |
host: db.feedtopicrules.dotcloud.com |
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 apply_omniauth(omniauth, save_it = false) | |
case omniauth['provider'] | |
when 'facebook' | |
self.apply_facebook(omniauth) | |
end | |
self.email = omniauth['user_info']['email'] if email.blank? | |
build_authentications(omniauth, save_it) | |
end | |
def build_authentications(omniauth, save_it = false) |
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
elsif current_user | |
current_user.apply_omniauth!(omniauth) | |
flash[:notice] = "Authentication successful." | |
redirect_to authentications_url |
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
# these lines of code does not take into account a facebook token if the user is already connected | |
elsif current_user | |
current_user.authentications.create!(:provider => omniauth['provider'], :uid => omniauth['uid']) | |
flash[:notice] = "Authentication successful." | |
redirect_to authentications_url |
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
class SampleJob | |
def perform | |
begin | |
# do all your work in the begin block. | |
puts "hello world" | |
rescue Exception => e | |
# rescue any errors so that you know something went wrong. Email yourself the error if you need. | |
error_msg = "#{Time.now} ERROR (SampleJob#perform): #{e.message} - (#{e.class})\n#{(e.backtrace or []).join("\n")}" | |
puts error_msg | |
ensure |
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
mislav-will_paginate -s http://gems.github.com | |
libxml-ruby | |
rest-client -s http://gems.github.com | |
plist | |
aws-s3 | |
htmlentities | |
paperclip | |
wireframe-apn_on_rails | |
configatron | |
geokit |