Skip to content

Instantly share code, notes, and snippets.

View Marsup's full-sized avatar

Nicolas Morel Marsup

  • Lyon, France
  • 01:01 (UTC +02:00)
View GitHub Profile
@Marsup
Marsup / hook-emit-group-parent-dynamic.js
Created September 22, 2011 12:48 — forked from temsa/hook-emit-group-parent-dynamic.js
Simple example for basic Hook.emit syntax using group feature
/*
* Simple example for basic Hook.emit syntax using group feature
*/
var Hook = require('../../../lib/hookio').Hook;
var server = new Hook({
name: "server-hook"
});
@Marsup
Marsup / h5bp-twitter-bootstrap
Created December 19, 2011 10:53 — forked from mklabs/bootstrap-plugins.txt
h5bp + twitter bootstrap integration
#!/usr/bin/env bash
src=$PWD
dirname=$(dirname $(readlink -f $0))
# need help ? if no args and help flags
if [ "$1" == '-h' ]
then
cat <<EOF
@Marsup
Marsup / test.js
Created September 20, 2012 07:09
request + connect bodyParser with 'json:true' issue
var connect = require('connect')
, http = require('http')
, request = require('request').defaults({ json: true })
var app = connect().use(connect.bodyParser())
, server = http.createServer(app)
server.listen(7777, function() {
request('http://localhost:7777')
})
@Marsup
Marsup / reverse.js
Created October 31, 2013 21:23
Hapi reverse proxy
var Hapi = require('hapi');
var server = new Hapi.Server('0.0.0.0', 3000);
server.route({
method: '*',
path: '/{path*}',
handler: {
proxy: {
host: 'amazon.com',
@Marsup
Marsup / test.js
Last active August 29, 2015 14:16
Weird lab bug
it('fails', function (done) {
var script = Lab.script();
script.experiment('test', function () {
script.test('1', function (finished) {
throw new Error('die');
});
});
@Marsup
Marsup / CustomError.js
Last active January 16, 2019 22:12
Custom error with cross browser support
const CustomError = function CustomError() {
if (Error.captureStackTrace) { // Chrome
Error.captureStackTrace(this, CustomError);
} else {
const err = new Error();
let processedStack, fileName, lineNumber;
Object.defineProperties(this, {
stack: {
get: function() {
@Marsup
Marsup / keybase.md
Created January 4, 2017 12:50
keybase.md

Keybase proof

I hereby claim:

  • I am marsup on github.
  • I am marsup (https://keybase.io/marsup) on keybase.
  • I have a public key whose fingerprint is AE39 5623 0B81 1467 8430 95A6 968E 96C3 E7CE 51F4

To claim this, I am signing this object: