Skip to content

Instantly share code, notes, and snippets.

View cherring's full-sized avatar
💭
Why do we even need this?

Chris Herring cherring

💭
Why do we even need this?
View GitHub Profile
def last_sunday_of_last_month
month = 1.month.ago
days = month.end_of_month.mday
date = Date.new(month.year, month.month, days)
Date.new(month.year, month.month, (days - date.wday))
end
Job failed to load: undefined method `keys' for nil:NilClass. Try to manually require the required file. (Delayed::Backend::DeserializationError)
Latest Bundler
source 'http://gemcutter.org'
gem 'rails', '3.0.0.beta3', :git => "git://github.com/rails/rails.git"
#:path => "/Users/chris/projects/open_source/rails"
gem 'pg'
gem 'haml'
gem "authlogic", :git => "git://github.com/bpokosh/authlogic.git"
def save
numbers_not_zero? ? super : false
end
<VirtualHost *>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.christas\-art\.com$ [NC]
RewriteRule ^(.*)$ http://christas-art.com/$1 [R=301,L]
ServerName christas-art.com
DocumentRoot /u/apps/art_production/current/public
RailsEnv production
<Directory "/u/apps/art_production/current/public">
map.resources :"foo-bar", :controller => "foo_bar", :only => [:new, :create, :index]
2010-07-16T17:10:45+1000: *** Starting job worker delayed_job host:jfrails2 pid:9214
2010-07-16T17:12:40+1000: * [Worker(delayed_job host:jfrails2 pid:9214)] acquired lock on ScorecardJob
2010-07-16T17:12:40+1000: * [JOB] delayed_job host:jfrails2 pid:9214 failed with ActiveRecord::StatementInvalid: PGError: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
: SELECT * FROM "outlets" - 0 failed attempts
2010-07-16T17:12:40+1000: * [Worker(delayed_job host:jfrails2 pid:9214)] acquired lock on ScorecardJob
2010-07-16T17:12:40+1000: * [JOB] delayed_job host:jfrails2 pid:9214 failed with ActiveRecord::StatementInvalid: PGError: no connection to the server
: SELECT * FROM "outlets" - 1 failed attempts
2010-07-16T17:12:40+1000: 2 jobs processed at 53.2326 j/s, 2 failed ...
grey='\e[0;90m'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$grey%}("
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$grey%}) %{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$grey%})"
function pat_prompt {
(( spare_width = ${COLUMNS} ))
prompt=" "
gem install autotest
gem install autotest/fs_event
gem install autotest/growl
gem install autotest/rails
#### ~/.autotest
require 'autotest/growl'
require 'autotest/fsevent'
So I have domain.com, and want to be able to access account.domain.com as a way of doing Account keys. That part was easy.
But I also want to have staging.domain.com to have my staging environment and need to be able to resolve account.staging.domain.com to get accounts on my staging server, at first I screwed this up by doing an A record for staging and one for *.staging.
All I actually needed was an A record for domain.com, and one for *.domain.com and covers everything, so that's what I have now.