Skip to content

Instantly share code, notes, and snippets.

Nicolas Morel Marsup

View GitHub Profile
View 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:

@Marsup
Marsup / CustomError.js
Last active Jan 16, 2019
Custom error with cross browser support
View CustomError.js
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 / test.js
Last active Aug 29, 2015
Weird lab bug
View test.js
it('fails', function (done) {
var script = Lab.script();
script.experiment('test', function () {
script.test('1', function (finished) {
throw new Error('die');
});
});
@Marsup
Marsup / reverse.js
Created Oct 31, 2013
Hapi reverse proxy
View reverse.js
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
Created Sep 20, 2012
request + connect bodyParser with 'json:true' issue
View test.js
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 / h5bp-twitter-bootstrap
Created Dec 19, 2011 — forked from mklabs/bootstrap-plugins.txt
h5bp + twitter bootstrap integration
View h5bp-twitter-bootstrap
#!/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 / hook-emit-group-parent-dynamic.js
Created Sep 22, 2011 — forked from temsa/hook-emit-group-parent-dynamic.js
Simple example for basic Hook.emit syntax using group feature
View hook-emit-group-parent-dynamic.js
/*
* Simple example for basic Hook.emit syntax using group feature
*/
var Hook = require('../../../lib/hookio').Hook;
var server = new Hook({
name: "server-hook"
});
You can’t perform that action at this time.