var Hapi = require('hapi');
var server = new Hapi.Server();
server.route({ method: 'get', path: '/hello', handler: function (request, reply) {
reply('World');
This file contains hidden or 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
#!/bin/bash | |
name="${1:-test}" | |
dir="${HOME}/.docker/machine/machines/${name}" | |
vmx="${dir}/${name}.vmx" | |
vmrun="/Applications/VMware Fusion.app/Contents/Library/vmrun" | |
# Something about the initial run of docker-machine+vmwarefusion needs sudo | |
sudo docker-machine create -d vmwarefusion "${name}" |
This file contains hidden or 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
# Git branch in prompt. | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ " | |
alias cls="clear" | |
alias ..="cd .." | |
alias ?="pwd" | |
alias ll="ll -l" |
This file contains hidden or 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
#include <MySensor.h> | |
#include <SPI.h> | |
#define LED_PIN 8 | |
#define RADIO_ID 20 | |
#define CHILD_ID 1 | |
MySensor gw; | |
MyMessage lightMsg(CHILD_ID, V_LIGHT); |
This file contains hidden or 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 Hapi = require('hapi'); | |
var server = new Hapi.Server(8000); | |
var commands = []; | |
server.route({ | |
method: 'GET', | |
path: '/{path*}', | |
handler: function (request, reply) { |
> process.platform
'darwin'
> process.platform = 'huh'
'huh'
> process.platform
'darwin'
> process.version
'v0.11.13'
This file contains hidden or 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
{ | |
"pack": { | |
"cache": "catbox-redis" | |
}, | |
"servers": [ | |
{ | |
"port": 8080, | |
"options": { | |
"labels": ["web"] | |
} |
This file contains hidden or 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
exports.register = function (plugin, options, callback) { | |
plugin.expose('util', function () { | |
console.log('something'); | |
}); | |
callback(); | |
}; |
This file contains hidden or 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
exports.register = function (plugin, options, callback) { | |
plugin.events.on('internalError', function (request, err) { | |
console.log(err); | |
}); | |
callback(); | |
}; |
This file contains hidden or 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
sortedRoutes = [ | |
'/', | |
'/user', | |
'/user/{userId}', | |
'/users/{userIds*}' | |
]; |