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 mongoi = require('mongoi'); | |
// connect to test database | |
mongoi.connect('mongodb://localhost/test'); | |
// register generic middleware | |
mongoi.use(function(context, next) { | |
// do some logging | |
next(); | |
}); |
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
[Service] | |
Restart=always | |
StandardOutput=syslog | |
SyslogIdentifier=nearby | |
Environment=PATH=/usr/bin | |
Environment=NODE_ENV=production | |
ExecStart=/usr/bin/node /srv/nearby/lib/index.js | |
[Install] | |
WantedBy=multi-user.target |
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 superagent = require('superagent') | |
var element = document.querySelector('#light'); | |
superagent.get('/light').end(function(err, res) { | |
element.dataset.state = res.body.on; | |
updateInnerText(element); | |
element.addEventListener('click', function(e) { |
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 fs = require('fs'); | |
var http = require('http'); | |
var express = require('express'); | |
var app = express(); | |
app.use(express.static(__dirname + '/../srv')); | |
fs.writeFile('/sys/class/gpio/export', '34', function(err) { | |
if (err) throw err; |
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 fs = require('fs'); | |
var builder = require('component-builder'); | |
var resolver = require('component-resolver'); | |
module.exports = function(options) { | |
var style, script = builder.scripts.require; | |
return function* builder(next) { | |
if (/build\.(js|css)/.test(this.url)) { |
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
<?xml version="1.0"?> | |
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> | |
<service_bundle type="manifest" name="node-app"> | |
<service name="node/node-app" type="service" version="1"> | |
<create_default_instance enabled="true"/> | |
<single_instance/> | |
<dependency name="network" grouping="require_all" restart_on="error" type="service"> | |
<service_fmri value="svc:/milestone/network:default"/> | |
</dependency> | |
<dependency name="filesystem" grouping="require_all" restart_on="error" type="service"> |
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
CPU ID FUNCTION:NAME | |
10 57934 :tick-60s | |
0x825c32c | |
0x8534229 | |
0x85272b1 | |
0xfed12dbd | |
0xfed12f50 | |
1 |
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
#!/bin/sh | |
# https://twitter.com/bodojs/status/476973611753152512 | |
# https://twitter.com/bodojs/status/476974684974501888 | |
# Bash Add-On Autoloader | |
[[ -d "$HOME/.bash" ]] || mkdir -p "$HOME/.bash" | |
[[ -f "$HOME/.bash/cl.sh" ]] || curl -o "$HOME/.bash/cl.sh" https://gist.githubusercontent.com/janl/e6ceb14ffcfca3556ba5/raw/b89254f3babe217bbdb085ad9a4df30cbbd6c1d8/cl.sh | |
source "$HOME/.bash/cl.sh" |
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
#!/bin/bash | |
source $HOME/.bash_profile | |
set -u | |
set -e | |
# directory name | |
NAME=$(basename $(pwd) .git) |
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
#!/bin/sh | |
# | |
# chkconfig: 35 99 99 | |
# description: node.js /home/bodokaiser/tmp/<name> | |
# | |
. /etc/rc.d/init.d/functions | |
# application name |
OlderNewer