Skip to content

Instantly share code, notes, and snippets.

Rodrigo Alviani rodrigoalviani

Block or report user

Report or block rodrigoalviani

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
nrollr /
Last active Sep 18, 2019
Install Node.js on Amazon Linux (EC2)

Installing Node.js on Amazon Linux AMI

The following will guide you through the process of installing Node.js on an AWS EC2 instance running Amazon Linux AMI 2016.09 - Release Notes

For this process I'll be using a t2.micro EC2 instance running Amazon Linux AMI (ami-d41d58a7). Once the EC2 instance is up-and-running, connect to your server via ssh

leonardofed /
Last active Dec 13, 2019
A curated list of AWS resources to prepare for the AWS Certifications

A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

View minimal-neuron.js
A neuron is basically the sum of its synapses.
Along with a trigger threshold, that's all we need to calculate
whether or not it will trigger at any given moment:
const neuron = ({ synapses = [], threshold = 1 } = {}) => ({
tanzaho / imageSyncing.js
Last active Aug 4, 2019
AWS Lambda - S3 : Thumbnail creation
View imageSyncing.js
// dependencies
var async = require('async');
var path = require('path');
var AWS = require('aws-sdk');
var gm = require('gm').subClass({
imageMagick: true
var util = require('util');
// get reference to S3 client
var s3 = new AWS.S3();
kolodny / bookmarklet.js
Last active Feb 23, 2019
Save any form to autofill for development, supports dynamic content with {{ Math.random() }} syntax
View bookmarklet.js
document.body.addEventListener('click', go);
alert('click on a form element to get a bookmarklet of the saved form');
function go(event) {
var form =;
while (form && form.tagName !== 'FORM') {
form = form.parentNode;
joakimbeng / test_runner.js
Last active Mar 16, 2017
A small and simple Javascript test runner
View test_runner.js
* A Javascript test runner in 20 lines of code
* From
(function () {
// The test queue:
var tests = [];
// Function to add tests:
this.test = function test (name, cb) {
View the80.js
$('*').each(function () {
var colors = ['aqua', 'blue', 'fuchsia', 'gray', 'green', 'lime', 'maroon', 'navy', 'olive', 'orange', 'purple', 'red', 'silver', 'teal', 'yellow'];
$(this).css('background-color', colors[Math.floor(Math.random()*colors.length)]);
$(this).css('font-family', 'Comic Sans MS');
$('img').each(function () {
var imgs = [
mathisonian /
Last active Dec 2, 2019
requiring npm modules in the browser console

demo gif

The final result: require() any module on npm in your browser console with browserify

This article is written to explain how the above gif works in the chrome (and other) browser consoles. A quick disclaimer: this whole thing is a huge hack, it shouldn't be used for anything seriously, and there are probably much better ways of accomplishing the same.

Update: There are much better ways of accomplishing the same, and the script has been updated to use a much simpler method pulling directly from browserify-cdn. See this thread for details:


danwit / passport_node_acl_example.js
Created May 1, 2014
Authentication and authorization with passportjs + node_acl + mongo + express
View passport_node_acl_example.js
* Simple authentication and authorization example with passport, node_acl,
* MongoDB and expressjs
* The example shown here uses local userdata and sessions to remember a
* logged in user. Roles are persistent all the way and applied to user
* after logging in.
* Usage:
* 1. Start this as server
You can’t perform that action at this time.