Skip to content

Instantly share code, notes, and snippets.

View hcientist's full-sized avatar

Michael Stewart hcientist

View GitHub Profile
@patrickberkeley
patrickberkeley / assets.js.erb
Created October 12, 2012 15:21 — forked from codebrew/assets.js.erb
javascript asset helper
App.assets = {
// Returns an object containing all of asset pipeline's image paths.
//
// Sample:
//
// {
// avatars/missing_avatar.png: "/assets/avatars/missing_avatar.png"
// chosen-sprite.png: "/assets/chosen-sprite.png"
// circle_green.png: "/assets/circle_green.png"
// circle_orange.png: "/assets/circle_orange.png"
@brandonhilkert
brandonhilkert / backbone.rails.js
Created August 26, 2012 19:01 — forked from somebox/backbone.rails.js
Makes Backbone.js with Rails+CSRF
//
// Backbone.Rails.js
//
// Makes Backbone.js play nicely with the default Rails setup, i.e.,
// no need to set
// ActiveRecord::Base.include_root_in_json = false
// and build all of your models directly from `params` rather than
// `params[:model]`.
//
// Load this file after backbone.js and before your application JS.
@mwinckler
mwinckler / sc2planner_printhack.js
Created April 26, 2012 20:50
SC2Planner.com format-for-print bookmarklet
(function() {
var boName = prompt('What do you want to name this build order?');
var supply = 6;
var orders = $('<ol></ol>').css({'list-style-type':'none'});
// For the duration this window is displayed, suspend the
// document events trapping selection/mousedown/etc so that
// the user can select/copy/paste the build order. See the
// click handler on the close buttons for event restoration.
var docEvents = jQuery.extend(true, {}, $(document).data('events'));