Skip to content

Instantly share code, notes, and snippets.

View geek's full-sized avatar
🏠
Working from home

Wyatt Preul geek

🏠
Working from home
View GitHub Profile
> ::dmods -l
ld.so.1
dcmd Bind - Display a Binding Descriptor
dcmd Callers - Display Rt_map CALLERS binding descriptors
dcmd Depends - Display Rt_map DEPENDS binding descriptors
dcmd ElfDyn - Display Elf_Dyn entry
dcmd ElfEhdr - Display Elf_Ehdr entry
dcmd ElfPhdr - Display Elf_Phdr entry
dcmd Groups - Display Rt_map GROUPS group handles
#!/usr/sbin/dtrace -s
pid$1::*HandleScopeC1*:entry
{
self->cone++;
}
pid$1::*HandleScopeD1*:entry
/self->cone/
{
@geek
geek / pack-server.js
Last active August 29, 2015 14:02
Example of using server packs to register plugins
var Hapi = require('hapi');
var Good = require('good');
var Reptile = require('reptile');
var pack = new Hapi.Pack();
pack.server(8000, { labels: ['web']});
pack.server(8001, { labels: ['admin']});
pack.register(Good, function (err) {});
server.route({
method: 'GET',
path: '/user/{userId}',
config: {
handler: retrieveUser,
response: {
sample: 50,
schema: {
name: Joi.string().required(),
email: Joi.string().required().email()
sortedRoutes = [
'/',
'/user',
'/user/{userId}',
'/users/{userIds*}'
];
exports.register = function (plugin, options, callback) {
plugin.events.on('internalError', function (request, err) {
console.log(err);
});
callback();
};
exports.register = function (plugin, options, callback) {
plugin.expose('util', function () {
console.log('something');
});
callback();
};
{
"pack": {
"cache": "catbox-redis"
},
"servers": [
{
"port": 8080,
"options": {
"labels": ["web"]
}
> process.platform
'darwin'
> process.platform = 'huh'
'huh'
> process.platform
'darwin'
> process.version
'v0.11.13'