Skip to content

Instantly share code, notes, and snippets.

@joshholt
joshholt / route_db_middle_ware.js
Created January 18, 2012 21:03
Express Route DB Middle ware
var _ = require('underscore');
var insertRecord, fetchRecord, updateRecord, deleteRecord;
insertRecord = function(db, req) {
db[req.params.guid] = '{}';
return "We have inserted a record for the instance represented by the GUID: " + req.params.guid;
};
fetchRecord = function(db, req) {
return db[req.params.guid]
@joshholt
joshholt / Procfile
Created January 19, 2012 16:38
Heroku Cedar Stack Procfile
web: node app.js
@joshholt
joshholt / rsync_func.sh
Created January 19, 2012 17:12
Bash Function to sync directories
#------------------------------------------------
# $1 should be the local dir you want to sync
# $2 should be the remote server path (i.e. user@remote:~/)
#------------------------------------------------
function rsync_dir () {
rsync --verbose --progress --stats --compress --rsh=/usr/bin/ssh --recursive --times --perms --links --delete --exclude "*bak" --exclude "*~" $1 $2
}
@joshholt
joshholt / package.json
Created January 23, 2012 21:09
Your Package.json file
{
"name": "my-first-provider",
"version": "0.0.1",
"dependencies" : {
"express": "2.5.0",
"jade": "0.16.4",
"underscore": "1.2.1"
}
}
@joshholt
joshholt / hidpi.txt
Created June 19, 2013 02:24 — forked from simX/hidpi.txt
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES;
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled;
// by the way, you need to logout and log back in for this to take effect. Or at least that's what
// Quartz Debug says. Who knows, maybe it's lying?
// P.S. Go to [Apple menu --> System Preferences --> Displays --> Display --> Scaled] after logging
// back in, and you'll see a bunch of "HiDPI" resolutions in the list to choose from.
@joshholt
joshholt / JolokiaCommands.md
Created October 11, 2017 17:19 — forked from yashpatil/JolokiaCommands.md
Jolokia URLs for quick access to A-MQ statistics

This is a quick reference to get to Jolokia statistics urls for JBoss Fuse or JBoss A-MQ statistics. Sometimes, when you are interested in very specific attributes, it's easier to keep monitoring a specific url rather than loading the full Hawtio console.