Skip to content

Instantly share code, notes, and snippets.

module.exports = {
get: function (req, res) {
res.sendfile(req.path.substr(1));
},
_config: {
rest: false,
shortcuts: false
}
};
@goliatone
goliatone / transition_events.js
Created March 11, 2014 16:02
cross browser transition events
var _getTransitionEvent = function(){
if(this._transition) return this._transition;
var transitions = {
'transition':'transitionend',
'OTransition':'oTransitionEnd',
'MozTransition':'transitionend',
'WebkitTransition':'webkitTransitionEnd'
};
return _transition = (function(){
var xmpp = require('node-xmpp'),
secret = require('./secret'),
util = require('util');
var creds = {
jid: '[email protected]',
password: secret.pw, //string
};
var GChat = function(creds) {
var _hasProp = {}.hasOwnProperty,
_inherit = function (child, parent) {
for (var key in parent) {
if (_hasProp.call(parent, key)) child[key] = parent[key];
}
if(typeof child === 'string') child = self;
function ctor() {
this.constructor = child;
@goliatone
goliatone / git_branch_by_date.sh
Created March 18, 2014 19:40
git, order branches by commit date
git for-each-ref --sort=-committerdate refs/heads/ --format='%(committerdate:short) %(authorname) %(refname:short)'
#2014-03-18 goliatone 251_how_a_bill_becomes_a_law_html_css
#2014-03-18 goliatone 292_what_you_can_do_timestamping
#2014-03-18 goliatone 138_WYCD_data_viz
nweb README for version 23
1) Bug fixed - was duplicating errors in the nweb.log file
- thanks to Kieran Grant for stopping this and pointing out the fix.
2) Added support for favicon.ico - if nothing elase this will stop annoying
errors in the log file. Most browsers on first encountering a webpage
also ask for this file. The name mean favourite icon - Wikipedia has
more on this. It is a tiny Bit Map image (normally called .bmp and
BMP editors can be used to create one - I used Windows Paint)
@goliatone
goliatone / ordinal_suffix.js
Created April 2, 2014 19:08
ordinal suffix
function getGetOrdinal(n) {
var s=["th","st","nd","rd"],
v=n%100;
return n+(s[(v-20)%10]||s[v]||s[0]);
}

README is empty

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
'git-describe': {
options: {
prop: 'meta.revision'
},
me: {}
},

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt