I hereby claim:
- I am rpheath on github.
- I am rpheath (https://keybase.io/rpheath) on keybase.
- I have a public key whose fingerprint is 5E40 EA52 A60E 8B8D 02BB A2BA AE6D ADC8 C7C8 8279
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
// Usage: | |
// $(function() { $(document).autosave(); }); | |
(function($) { | |
// initialize the namespace with an empty timer | |
$.autosave = { timer: null }; | |
// NOTE: all actionable methods below provide hooks that you can | |
// bind to as needed (both before/after hooks are triggered) |
class Article < ActiveRecord::Base | |
# ... | |
def embedded_links | |
self.body_html.scan(/<a.+?href="(.+?)".+?/) if body_html | |
end | |
def has_links? | |
self.embedded_links.flatten.present? | |
end |
// handles caching and rendering templates | |
var Template = (function() { | |
// initialize private method container | |
var TemplateHandler = function() {}; | |
// private methods | |
TemplateHandler.prototype = { | |
// used to hold the collection of | |
// key/value cached templates | |
templates: {}, |
Just install this in your apps like so:
gem 'test-spec-mini', :git => 'git://gist.github.com/1806986.git', :require => 'mini'
# Playing around with CoffeeScript... | |
##################################################################################### | |
# Validator needs to inherit from Module class so we can support mixins | |
class Module | |
@include: (obj) -> | |
for key, value of obj | |
@::[key] = value | |
# ----------------------------------------------------------------------------------- |
development: | |
subdomain: development-subdomain | |
api_key: XXX | |
site_key: XXX | |
production: | |
subdomain: production-subdomain | |
api_key: XXX | |
site_key: XXX |