Skip to content

Instantly share code, notes, and snippets.

View zemccartney's full-sized avatar

Zack McCartney zemccartney

View GitHub Profile
@zemccartney
zemccartney / puppeteer-debug.js
Created November 17, 2023 17:58
puppeteer-debug
'use strict';
const Puppeteer = require('puppeteer');
module.exports = {
method: 'GET',
path: '/debug',
handler: async (request) => {
let browser;
@zemccartney
zemccartney / hapi-crash-only.js
Last active September 19, 2019 16:08
Very rough crash-only hapi server
'use strict';
// Adapted from Exiting README example: https://github.com/kanongil/exiting
const Boom = require('@hapi/boom');
const Exiting = require('exiting');
const Hapi = require('@hapi/hapi');
const server = Hapi.Server();
const manager = Exiting.createManager(server);
@zemccartney
zemccartney / crash-only-pal.js
Last active September 19, 2019 12:52
hapi crash-only
'use strict';
/*
Inspired by ideas in:
- https://www.joyent.com/node-js/production/design/errors
- https://www.usenix.org/legacy/events/hotos03/tech/full_papers/candea/candea.pdf
*/