Skip to content

Instantly share code, notes, and snippets.

// i18n string format method
// usage: messageFormat("hello {0}, welcome {1}", "James", "Home");
function messageFormat(str) {
var args = arguments;
return str.replace(/{(\d)}/g, function(r, n) { return args[+n+1];});
}
(cls\s*:\s*|(class|cssClass|size)=)(['"])([\w\s]*\s)?CLASSNAMEHERE\b
String.prototype.pad = function(n, str) { return (new Array(n - this.length)).join(str || "0"); };
@mobz
mobz / keybase.md
Created July 15, 2014 23:29
keybase.md

Keybase proof

I hereby claim:

  • I am mobz on github.
  • I am mobz (https://keybase.io/mobz) on keybase.
  • I have a public key whose fingerprint is 2EBE 8869 018A 03E6 7E59 034F D6A4 BEF4 A2AF B241

To claim this, I am signing this object: