Skip to content

Instantly share code, notes, and snippets.

View nvcexploder's full-sized avatar

Ben Acker nvcexploder

  • Joyent/Samsung
  • The Woods, North Carolina
View GitHub Profile
@nvcexploder
nvcexploder / master.vim
Created February 23, 2017 14:18 — forked from benjamincharity/master.vim
Master Vim with this interactive tutorial.
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)
@nvcexploder
nvcexploder / onreq.js
Created August 7, 2014 01:33
Change URL in a hapi onRequest ext point.
// wherever you're setting up your server, this was within a register method for a plugin:
plugin.select('api').ext('onRequest', internals.onRequest);
//somewhere else in that file or whatever
var onRequest = function (request, next) {
request.setUrl(exports.rewriteUrl(request.raw.req.url));
next();

Keybase proof

I hereby claim:

  • I am nvcexploder on github.
  • I am benacker (https://keybase.io/benacker) on keybase.
  • I have a public key ASBfdz0pXE7jpW_iXuJxTg35h1Y41RxAm0R-Vp58HNeP-Qo

To claim this, I am signing this object:

@nvcexploder
nvcexploder / hapiExample.js
Last active July 25, 2021 05:39
basic hapi.js example highlighting HTTP methods and a few request parameters
/*
For this to run, ensure that `npm install hapi` has happened in your directory
setup whilst writing this:
iojs v. 1.0.5
hapi 8.2.0
*/
var Hapi = require('hapi');
@nvcexploder
nvcexploder / server.js
Created October 21, 2014 00:59
Creating a TLS server in hapi.js
var Hapi = require('hapi');
var Fs = require('fs');
var options = {
tls: {
key: Fs.readFileSync(your_key),
cert: Fs.readFileSync(your_cert)
}
};