Skip to content

Instantly share code, notes, and snippets.

Avatar

Austin Bales arbales

View GitHub Profile
@shesek
shesek / i18n.coffee
Created Nov 14, 2011 — forked from madrobby/i18n.coffee
i18n with CoffeeScript
View i18n.coffee
# 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 Nov 14, 2011 — forked from madrobby/i18n.coffee
Backbone i18n with CoffeeScript
View i18n.coffee
window.t = (id, vars = {}) ->
template = i18n[__locale][id] or i18n['en'][id] or "(?) #{id}"
_.template(template, vars)
# yes, that's it
View example.js
__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 Dec 4, 2009
Badass git pull alias (up) to show commit log that just got pulled in addition to changes
View ._what.md

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.