Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrea Ercolino aercolino

View GitHub Profile
View $.news.js
jQuery.news = (function($) {
var broker = $({});
return {
subscribe: function() {
$.fn.on.apply(broker, arguments);
},
unsubscribe: function() {
@aercolino
aercolino / 0_reuse_code.js
Created Mar 14, 2016
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
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);
return;
}