Skip to content

Instantly share code, notes, and snippets.

@bitzesty
bitzesty / embedded_uniqueness_validations.rb
Created December 23, 2009 14:40 — forked from jnunemaker/embedded_uniqueness_validations.rb
MM embedded_uniqueness_validations
require 'pp'
require 'rubygems'
require 'mongo_mapper'
MongoMapper.database = 'testing'
class Rating
include MongoMapper::EmbeddedDocument
key :user_id, ObjectId
@bitzesty
bitzesty / github-repos-talker-plugin.js
Created December 15, 2009 15:51
talker plugin for formatting github repos
plugin.onMessageInsertion = function(event){
var github_status_expression = /https*:\/\/github.com\/(.*)\/(.*)/i;
var last_anchor = Talker.getLastInsertion().find('a');
var last_href = last_anchor.attr('href') || '';
if (github_status_expression.test(last_href)){
var author = last_href.match(github_status_expression)[1];
@bitzesty
bitzesty / _README.md
Created December 13, 2009 20:36 — forked from kneath/_README.md

GitHub Javascript Strategy

Unless otherwise necessary (such as mobile development), the GitHub javascript codebase is based off jQuery. You can safely assume it will be included on every page.

File naming

  • All jquery plugins should be prefixed with jquery, such as jquery.facebox
  • All github-specific jquery plugins should be prefixed with jquery.github. Like jquery.github.repo_list.js
  • All page-specific files (that only run on ONE page) should be prefixed with page. page.billing.js