Skip to content

Instantly share code, notes, and snippets.

View aercolino's full-sized avatar

Andrea Ercolino aercolino

View GitHub Profile
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);
return;
}
@aercolino
aercolino / 0_reuse_code.js
Created March 14, 2016 13:34
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@aercolino
aercolino / $.news.js
Last active August 29, 2015 14:02 — forked from cowboy/HEY-YOU.md
jQuery.news = (function($) {
var broker = $({});
return {
subscribe: function() {
$.fn.on.apply(broker, arguments);
},
unsubscribe: function() {