Skip to content

Instantly share code, notes, and snippets.


Andrea Ercolino aercolino

View GitHub Profile
View mongodb-atlas-lambda-step1.js
function processEvent(event, context, callback) {
const storableEvent = makeEventStorable(event);
storableEvent.created_at = new Date();
console.log('Calling MongoDB Atlas from AWS Lambda: ', JSON.stringify(storableEvent));
if (cachedDb) {
console.log('- Reusing cached connection');
createDoc(cachedDb, storableEvent, callback);
aercolino / 0_reuse_code.js
Created March 14, 2016 13:34
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
aercolino / $.news.js
Last active August 29, 2015 14:02 — forked from cowboy/
View $.news.js = (function($) {
var broker = $({});
return {
subscribe: function() {
$.fn.on.apply(broker, arguments);
unsubscribe: function() {