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
var DateHelper = { | |
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time | |
// Ruby strftime: %b %d, %Y %H:%M:%S GMT | |
time_ago_in_words_with_parsing: function(from) { | |
var date = new Date; | |
date.setTime(Date.parse(from)); | |
return this.time_ago_in_words(date); | |
}, | |
time_ago_in_words: function(from) { |
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
#### Example of CruiseControl.rb cruise_config.rb which dynamically picks #### | |
#### the version of Rails to use based on CCRB project name #### | |
# cruise_config.rb: | |
require 'fileutils' | |
Project.configure do |project| | |
project.email_notifier.emails = ["chad+sandbox-ci-#{Socket.gethostname.chomp.downcase}@mycompany.com"] | |
require "#{File.dirname(__FILE__)}/vendor/plugins/shared_stuff/lib/cruise/mycompany_cruise_config.rb" |
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
### Mailer configuration from config/environments/production.rb | |
# Documnentation: | |
# * http://wiki.rubyonrails.com/rails/pages/HowToSendEmailsWithActionMailer | |
# * http://api.rubyonrails.org/classes/ActionMailer/Base.html | |
# Let MTA handle deliveries asynchronously, rather than using default synchronous SMTP | |
config.action_mailer.delivery_method = :sendmail | |
# Let MTA handle errors, do not raise exceptions |
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
diff --git a/app/models/user.rb b/app/models/user.rb | |
index b35c1a8..4f8223d 100644 | |
--- a/app/models/user.rb | |
+++ b/app/models/user.rb | |
@@ -80,6 +80,15 @@ class User < ActiveRecord::Base | |
super | |
end | |
+ def identity_url=(url) | |
+ begin |
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
/* | |
* The MIT License | |
* | |
* Copyright (c) 2009 James F. Herdman | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
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
# Add some alias'es to FillingRequest map the attributes directly | |
def legal_business_name | |
self.company | |
end | |
def legal_business_name=(v) | |
self.company = v | |
end | |
def phone_number |
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
#!/usr/bin/env ruby | |
# | |
# usage: script/server_restarter | |
# | |
# Rails autoloading, while nice in theory, frequently doesn't work. Since Rails 2.3+ | |
# is so fast when completely reloading the server, I wrote this script to listen to the | |
# given directories, and kill/restart the server when any file is changed. | |
# | |
# It's quick, simple, and it reliably reloads your application when changes are made. | |
# |
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 :integrity => ['config/database.yml', 'test'] | |
file 'config/database.yml' do | |
cp 'config/database.yml.sample', 'config/database.yml' | |
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
LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-2.0.6/ext/apache2/mod_passenger.so | |
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-2.0.6 | |
PassengerRuby /usr/local/bin/ruby | |
NameVirtualHost * | |
<VirtualHost *> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /home/edavis/integrity/public | |
<Directory /home/edavis/integrity/public"> |
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
echo -e "This is a summary of disk usage on your server:\n\n `df -h`\n\nUptime: `uptime`" | mail -s "System report for `hostname` on `date`" my_email@gmail.\com |