Skip to content

Instantly share code, notes, and snippets.

RAILS_ROOT = '/var/www/apps/fetcher/production/current'
FETCHER_SCRIPT = "#{RAILS_ROOT}/script/email_fetcher"
God.watch do |w|
w.name = "fetcher-daemon"
w.uid = 'deploy'
w.gid = 'users'
w.interval = 30.seconds
w.start = "RAILS_ENV=production #{FETCHER_SCRIPT} start &"
w.stop = "RAILS_ENV=production #{FETCHER_SCRIPT} stop &"
require 'rational'
require 'rubygems'
require 'exifr' rescue nil
module Randy
# converts dms in [Rational(75, 1), Rational(452, 25), Rational(0, 1)] to a float
def self.dms_to_float(dms)
if dms == nil || (dms.size != 3) && !dms.map{|i| i.class == Rational}.all?
raise ArgumentError, "We need an array of 3 Rational numbers. k thx bai."
end
@r38y
r38y / README.textile
Created August 26, 2008 15:20
Cohackfest website

Cohackfest

  1. First rule of cohackfest, no client work
  2. Second rule of cohackfest, NO CLIENT WORK!

(see what I did there?)

Inspiration

“This, after all, is how GitHub was started. Tom and I had full time gigs,

??
RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
Rails::Initializer.run do |config|
config.gem 'thoughtbot-factory_girl', :lib => 'factory_girl', :source => 'http://gems.github.com'
config.gem 'right_aws'
# config.log_level = :debug
def notifications(request)
organization_sfdc_id = params['Envelope']['Body']['notifications']['OrganizationId']
object_class = params['Envelope']['Body']['notifications']['Notification']['sObject']['xsi:type'].gsub(/sf:/, '')
logger.fatal("organization_sfdc_id: #{organization_sfdc_id}")
logger.fatal("object_class: #{object_class}")
begin
if ['Lead', 'Contact'].include?(object_class)
organization = Organization.find_by_sfdc_id(organization_sfdc_id)
organization.setup
notifications = request.notification
class MyAccount::PostsController < ApplicationController
before_filter :login_required
def index
@posts = current_user.posts.paginate :page => params[:page], :order => 'created_at DESC'
end
def toggle_visibility
@post = current_user.posts.find params[:id]
@post.toggle!(:visible)
require File.dirname(__FILE__) + '/../spec_helper'
require 'action_controller/integration'
# $:.unshift '/home/rlusk/projects/crm/txnew/test/mocks/test/'
# require "#{File.dirname(__FILE__)}/../test_helper"
# require 'pp'
# require 'action_controller/dispatcher'
#
# x = ActionController::Dispatcher
# module ActionController
# class Dispatcher
require 'timeout'
class Twitter
def initialize(username, password)
@username = username
@password = password
end
def url
@url ||= URI.parse("http://twitter.com/statuses/update.xml")
end
def name
commenter.try(:name) || super || "Anonymous Coward"
end