Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View arbales's full-sized avatar

Austin Bales arbales

View GitHub Profile
@shesek
shesek / i18n.coffee
Created November 14, 2011 22:38 — forked from madrobby/i18n.coffee
i18n with CoffeeScript
# Works with `global` instead of `window` when available (nodejs environment), no Backbone dependency,
# no ev[ai]l for rendering variables and a shorter `{...}` syntax.
(global or window).t = (id, vars = {}) ->
(i18n[__locale][id] or i18n.en[id] or "(?) #{id}")
.replace /\{(\w+)\}/g, (a, k) -> vars[k] or "?#{k}"
###
i18n=
@srdjan
srdjan / i18n.coffee
Created November 14, 2011 20:06 — forked from madrobby/i18n.coffee
Backbone i18n with CoffeeScript
window.t = (id, vars = {}) ->
template = i18n[__locale][id] or i18n['en'][id] or "(?) #{id}"
_.template(template, vars)
# yes, that's it
@michaelficarra
michaelficarra / example.js
Created October 6, 2010 03:53
JS classical OOP
__extends = function(parent, child) {
var ctor = function(){};
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.prototype.constructor = child;
if(typeof parent.extended === 'function') parent.extended(child);
child.__super__ = parent.prototype;
return child;
};
@kneath
kneath / ._what.md
Created December 4, 2009 18:23
Badass git pull alias (up) to show commit log that just got pulled in addition to changes

Badass git pull alternative

Add this little snippet to your ~/.gitconfig and it amps up your git pull by means of git up

  1. Adds in a list of the commits you're pulling down
  2. Auto-prunes remote branches
  3. Defaults to pull --rebase - gets rid of unnecessary merge commits. If you don't know what rebase does, this is probably safe for you. If you know what rebase does, you should know where this will not be safe for you.

Scott Chacon and Ryan Tomayko basically figured out how to do this and I am stealing all of the credit.