Skip to content

Instantly share code, notes, and snippets.

@nathansmith
nathansmith / module_pattern_init.js
Created January 11, 2010 17:08
Init + Module Pattern JS
// JS Module Pattern:
// http://j.mp/module-pattern
// Redefine: $, window, document, undefined.
var APP = (function($, window, document, undefined) {
// Automatically calls all functions in APP.init
$(document).ready(function() {
APP.go();
});
@standout
standout / post.rb
Created August 13, 2009 12:56
Super simple spam protection for Ruby on Rails
class Post < ActiveRecord::Base
attr_accessor :comment # fake attribute used for spam trapping
validates_length_of :comment, :in => 0..1
end