Skip to content

Instantly share code, notes, and snippets.

View caridy's full-sized avatar

Caridy Patiño caridy

  • Salesforce, Inc.
  • Miami, FL.
  • X @caridy
View GitHub Profile
@caridy
caridy / about.md
Last active April 7, 2022 19:07 — forked from rauschma/about.md
Transferring objects between a ShadowRealm and an incubator realm

Transferring objects between a ShadowRealm and an incubator realm

Material:

@caridy
caridy / a.js
Last active February 3, 2017 23:28 — forked from dherman/a.js
a tiny userland registry, using a "parse" and "link" primitive
import {b} from "./b.js";
import $ from "jquery";
export function a() {
// ...
}

Proposal for Extending Express Apps

Creating npm packages which extend the functionality of Express apps has become a major thing we've been doing. There are several approaches we can take, from messing with the Express object prototypes, to creating a function in which an express app is passed in. After trying the former, I'm now a fan of the latter.

The Issues with Extending Express

Extending the Express object prototypes has issues. The running Node.js process may have multiple versions of express, and in order to extend the prototypes you need to require('express'). This means that you might get a different express module instance than the one the main app is created from.

Both approaches suffer from extending something more than once. Similar to how there may be multiple version of express in the running Node.js process, there can also be multiple copies of the extension modules. If the app developer needs to rely on a different version of an Express ext

/*jslint anon:true, sloppy:true, nomen:true*/
YUI.add('clickMojit', function(Y, NAME) {
/**
* The clickMojit module.
*
* @module clickMojit
*/
/**
@caridy
caridy / build.sh
Created December 13, 2012 20:55 — forked from isao/build.sh
#!/bin/sh -ex
appname=${1:-hybrid}
bldname=$appname-bld
statdir=yahoo.application.$appname
mojitodir=/Users/caridy/repo/mojito
pwd
mojito create app hybrid $appname
@caridy
caridy / digg.js
Created October 31, 2011 15:17 — forked from davglass/digg.js
#!/usr/bin/env node
var YUI = require("yui3").YUI;
YUI({
debug: true
}).use('node', 'io', function(Y) {
//Messing with the main page..
Y.one('title').set('innerHTML', 'Digg News Headlines');