Skip to content

Instantly share code, notes, and snippets.

@houoop
houoop / get-tomorrow-date.js
Created April 28, 2013 03:44
js get tomorrow date
new Date(new Date().getTime() + 24 * 60 * 60 * 1000)
@houoop
houoop / pre-commit.py
Created April 28, 2013 09:56
git pre-commit jshit
#!/usr/bin/env python
import os, sys
"""
Checks your git commit with JSHint. Only checks staged files
"""
def jshint():
errors = []
@houoop
houoop / underscore for rails.js
Created May 7, 2013 09:30
underscore template for rails
_.templateSettings = {
interpolate: /\{\{\=(.+?)\}\}/g,
evaluate: /\{\{(.+?)\}\}/g
};
@houoop
houoop / js-date-format.js
Created May 10, 2013 08:30
format js date
var formatDate = function(time) {
return [time.getFullYear(), '-', time.getMonth() + 1, '-', time.getDate(),
' ', time.getHours(), ':', time.getMinutes(), ':',
time.getSeconds()].join('');
};