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 swig = require('swig'); | |
var source = ''; | |
source += '{% escapes true %}'; | |
source += '<li>{{ name }}</li>'; | |
source += '{% endescapes %}'; | |
swig.setTag('escapes', parse, compile, true, false); |
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
# The idea is to do a HEAD request on a large file on an apache server with multiple byte ranges in multiple connections. | |
# The server then will have to read this large file from all the given byte ranges without returning any content | |
# (as it is a HEAD) request. If we do this about > 500 times in parallel the memory will collapse with | |
# the apache process crashing down. | |
import sys | |
import socket | |
header = '' |
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
events { | |
worker_connections 1024; | |
} | |
http { | |
charset UTF-8; | |
upstream example { | |
server 127.0.0.1:3000; | |
keepalive 32; |
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 |