Skip to content

Instantly share code, notes, and snippets.

View exitmusic's full-sized avatar

Kai Chang exitmusic

  • Morningstar
  • Chicago, IL
View GitHub Profile
@exitmusic
exitmusic / database.yml
Created January 5, 2012 16:46 — forked from aokolish/database.yml
how to get postgresql working locally with rails
development:
adapter: postgresql
database: <db_name>
encoding: utf8
username: <username>
password:
host: localhost
# ...
@exitmusic
exitmusic / jquery.validator.js
Created August 31, 2011 01:28 — forked from thegrubbsian/jquery.validator.js
A very simple validation plugin for jQuery in just over 100 lines.
(function(jQuery) {
jQuery.fn.validator = function(options) {
var isEmpty = function(obj) { return obj == null || obj.length == 0; };
var opts = jQuery.extend(true, { // Allows for overriding any messages or validator functions
wrapperClass: "invalid", messageClass: "message", useMessages: true,
onValidation: null, onValidationFailed: null, // Callbacks which recieve an object containing the element and state { el: el, state: state }
validateOn: "blur", // The jQuery events that cause validation to occur