This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
module AfterCommit | |
def self.included(base) | |
base.class_eval do | |
[:save, :save!].each do |method| | |
alias_method_chain method, :after_commit | |
end | |
end | |
base.define_callbacks :after_commit, :after_commit_on_create | |
end | |
module AfterCommit | |
def self.included(base) | |
base.class_eval do | |
[:save, :save!].each do |method| | |
alias_method_chain method, :after_commit | |
end | |
end | |
base.define_callbacks :after_commit, :after_commit_on_create | |
end | |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
# Track the status and trigger buid for hudson CI. | |
# | |
# ci list all/projects - list all the projects on Hudson | |
# ci status <project name> - see a project's status | |
# ci build <project name> - triger a build on hudson | |
Http = require 'http' | |
QS = require 'querystring' | |
module.exports = (robot) -> |
$.subscribe = (event, handle) -> | |
if not o[event] | |
o[event] = [] | |
o[event].push handle | |
true | |
$.unsubscribe = (event) -> | |
if o[event] | |
delete o[event] |
time_ago_in_words(item.created_at) |
<div class="post"> | |
<time class="timeago" datetime="2012-07-18T07:51:50Z"> | |
about 8 hours ago | |
</time> | |
</div> | |
<div class="comment"> | |
<time class="timeago" datetime="2012-07-18T15:50:50Z"> | |
about 1 minute ago | |
</time> |
Request summary | |
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | |
Parsed lines: 389 | |
Skipped lines: 0 | |
Parsed requests: 122 | |
Skipped requests: 0 | |
Warnings: teaser_check_failed: 1 | |
First request: 2012-05-14 15:44:03 |
#>>lang=cf | |
@Factory = Factory = {} | |
ids = {} | |
sequences = {} | |
sequence = (name, callback) -> sequences[name] = callback | |
define = (name, defaults = {}) -> | |
Factory[name] = (attrs = {}) -> |
# first install erlang using the R13b04 formula | |
brew install https://github.com/mxcl/homebrew/raw/810d52f4a386ea9e2b837030120ffd69cad73722/Library/Formula/erlang.rb | |
# now you are free to install riak | |
brew install riak |