This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var formatDate = function(time) { | |
return [time.getFullYear(), '-', time.getMonth() + 1, '-', time.getDate(), | |
' ', time.getHours(), ':', time.getMinutes(), ':', | |
time.getSeconds()].join(''); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.templateSettings = { | |
interpolate: /\{\{\=(.+?)\}\}/g, | |
evaluate: /\{\{(.+?)\}\}/g | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os, sys | |
""" | |
Checks your git commit with JSHint. Only checks staged files | |
""" | |
def jshint(): | |
errors = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Date(new Date().getTime() + 24 * 60 * 60 * 1000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bind: window.dispatchEvent ? function(el, type, fn, phase) { | |
el.addEventListener(type, fn, !!phase); | |
return fn; | |
} : function(el, type, fn) { | |
el.attachEvent && el.attachEvent("on" + type, fn); | |
return fn; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sublime Text 2 - Default shortcuts cheatsheet (PC keyboard) | |
----------------- | |
General | |
----------------- | |
* Go to file (CTRL + P) | |
* Go to project (CTRL + ALT + P) | |
* Go to methods (CTRL + R) | |
* Go to line (CTRL + G) | |
* Toggle side bar (CTRL + KB) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function S4() { | |
return (((1+Math.random())*0x10000)|0).toString(16).substring(1); | |
} | |
function guid() { | |
return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.dedupe=function () { | |
var hash={},result=[], | |
hasown=Object.prototype.hasOwnProperty; | |
for (var i = this.length - 1; i >= 0; i--) { | |
if(!hasown.call(hash,this[i])){ | |
hash[this[i]]=1; | |
result.push(this[i]); | |
} | |
}; | |
return result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
width: 200px; | |
white-space: nowrap; | |
overflow: hidden; | |
text-overflow: ellipsis; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--[if lte IE 7]> | |
<![endif]--> |
NewerOlder