Skip to content

Instantly share code, notes, and snippets.

View CodeOfficer's full-sized avatar

Russell Jones CodeOfficer

View GitHub Profile
@rx
rx / gist:1118201
Created August 1, 2011 14:18 — forked from cmorss/gist:1076315
Jammit Handlebar Template funciton
Handlebars.template = function(templateString) {
return function () {
if (arguments.length < 1) {
// With no arguments, return the raw template -- useful for rendering
// partials.
return templateString;
} else {
Handlebars.templates = Handlebars.templates || {}
Handlebars.templates[templateString] = Handlebars.templates[templateString] || Handlebars.compile(templateString);
return Handlebars.templates[templateString](arguments[0], arguments[1]);
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@strangeminds
strangeminds / hackintosh
Created October 17, 2011 03:32
Hackintosh Build October 2011
Hackintosh Build October 2011
Component list:
ASUS P8P67 PRO (REV 3.0) LGA 1155
http://www.newegg.com/Product/Product.aspx?Item=N82E16813131703
Intel Core i7-2600K
http://www.newegg.com/Product/Product.aspx?Item=N82E16819115070
@addyosmani
addyosmani / pubsub.md
Created October 28, 2011 06:49
Four ways to do Pub/Sub with jQuery 1.7 and jQuery UI (in the future)

#Four Ways To Do Pub/Sub With jQuery and jQuery UI (in the future)

Between jQuery 1.7 and some of work going into future versions of jQuery UI, there are a ton of hot new ways for you to get your publish/subscribe on. Here are just four of them, three of which are new.

(PS: If you're unfamiliar with pub/sub, read the guide to it that Julian Aubourg and I wrote here http://msdn.microsoft.com/en-us/scriptjunkie/hh201955.aspx)

##Option 1: Using jQuery 1.7's $.Callbacks() feature:

$.Callbacks are a multi-purpose callbacks list object which can be used as a base layer to build new functionality including simple publish/subscribe systems. We haven't yet released the API documentation for this feature just yet, but for more information on it (including lots of examples), see my post on $.Callbacks() here:

@CodeOfficer
CodeOfficer / application.coffee
Created November 2, 2011 19:41
jQuery mobile and backbone.js
#
# Some helper methods
#
app =
activePage: ->
$(".ui-page-active")
reapplyStyles: (el) ->

Step 1: Install bundler

# on OSX, using built-in Ruby
$ sudo gem install bundler --pre

Step 2: Create a Gemfile

# inside your app directory
$ bundle init
@dpickett
dpickett / link_like_button.scss
Created December 31, 2011 19:55
link_like_button.scss
@dudleyf
dudleyf / AssetFile
Created January 4, 2012 00:46 — forked from nicholasjhenry/AssetFile
AssetFile for Rake Pipeline for use with ember.js/handlebars
require "json"
require "rake-pipeline-web-filters"
input "assets"
output "public"
class HandlebarsFilter < Rake::Pipeline::Filter
def initialize(&block)
block ||= proc { |input| input.sub(/\.handlebars$/, '.js') }
super(&block)
@joewest
joewest / didRequestRange.js
Created January 13, 2012 20:14
Ember.PaginationSupport
App.collectionController = Em.ArrayProxy.create(Ember.PaginationSupport, {
content: [],
fullContent: App.store.findAll(App.Job),
totalBinding: 'fullContent.length',
didRequestRange: function(rangeStart, rangeStop) {
var content = this.get('fullContent').slice(rangeStart, rangeStop);
this.replace(0, this.get('length'), content);
}
});
{"api_response":{"tags":"","groupPointAward":"0","fullUrl":"http://newsit.net/assets/badges/multitasker.png","dateIssued":"1327945543","pointAward":"0","serviceType":"1","endTime":"0","rules":{"Rule":{"actionTag":"Video_Watch","achieved":"0","sortOrder":"1","serviceActionType":"none","type":"count","serviceType":"nitro","operator":"GE","goal":"1","completed":"false"}},"ruleMatchType":"0","startTime":"1327945543","completionCount":"0","hideUntilEarned":"0","name":"Be a Multitasker Workaround Test","repeatable":"0","folderName":"Participation","groupFlag":"0","applyMultiplier":"0","pointCategory":"Points","dailyAchievementLimit":"0"}}