This file contains hidden or 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
namespace :cron do | |
task :start, :roles => :app, :only => {:cron => true} do | |
cron_tab = "#{shared_path}/cron.tab" | |
run "mkdir -p #{shared_path}/log/cron" | |
require 'erb' | |
template = File.read("config/cron.erb") | |
file = ERB.new(template).result(binding) | |
put file, cron_tab, :mode => 0644 |
This file contains hidden or 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
username: [email protected] # or for google apps: [email protected] | |
password: dude123 | |
host: imap.gmail.com | |
port: 993 |
This file contains hidden or 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
Rails::Initializer.run do |config| | |
... | |
config.gem "lockfile" | |
config.gem "tmail" | |
... | |
end |
This file contains hidden or 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
task :each_minute => :environment do | |
chore("Each minute") do | |
# big thanks to | |
# require rails environment file which basically "boots" up rails for this script | |
require File.join(File.dirname(__FILE__), '..', '..', 'config', 'environment') | |
require 'net/imap' | |
require 'net/http' | |
begin | |
Lockfile.new('cron_mail_fetcher.lock', :retries => 0) do |
This file contains hidden or 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
rake email:invitations RAILS_ENV=production |
This file contains hidden or 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 Video < ActiveRecord::Base | |
# Paperclip | |
# http://www.thoughtbot.com/projects/paperclip | |
has_attached_file :video, | |
:storage => :s3, | |
:s3_credentials => "#{RAILS_ROOT}/config/s3.yml", | |
:path => ":attachment/:id/:style/:basename.:extension", | |
:bucket => 'yourbucketname' | |
This file contains hidden or 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
access_key_id: YOURSECRETACCESSID | |
secret_access_key: YOUR-secRE/TACCe\ssKEy |
This file contains hidden or 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 VideosController < ApplicationController | |
def index | |
@videos = Video.find :all | |
end | |
def new | |
@video = Video.new | |
end | |
This file contains hidden or 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
Rails::Initializer.run do |config| | |
... | |
config.gem 'right_aws', :version => '1.9.0' | |
... | |
end |
This file contains hidden or 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
<head> | |
<meta http-equiv="content-type" content="text/html;charset=UTF-8" /> | |
<title><%= SITE_NAME %></title> | |
<%= stylesheet_link_tag 'application' %> | |
<%= javascript_include_tag :defaults %> | |
<%= javascript_include_tag 'swfobject' %> | |
</head> |