Skip to content

Instantly share code, notes, and snippets.


Alexander Elias vokeio

Block or report user

Report or block vokeio

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
nooges /
Created Oct 11, 2017
Script for flashing .hex file onto Pro Micro with avrdude
#!/usr/bin/env bash
if grep -q -s Microsoft /proc/version; then
echo 'ERROR: Pro Micros can not be flashed within the Windows Subsystem for Linux (WSL) currently. Instead, take the .hex file generated and flash it using AVRDUDE, AVRDUDESS, or XLoader.'
exit 1
if [ "$#" -ne 1 ]; then
vlucas / encryption.js
Last active Oct 19, 2019
Stronger Encryption and Decryption in Node.js
View encryption.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv);
jung-kim / map-perf.js
Last active Jul 6, 2019
es6 map vs array vs obj performance test
View map-perf.js
"use strict";
let looper = (callback) => {
let n = 2000000;
while (n > 0) {
skeggse / crypto-pbkdf2-example.js
Last active Jun 19, 2019
Example of using crypto.pbkdf2 to hash and verify passwords asynchronously, while storing the hash and salt in a single combined buffer along with the original hash settings
View crypto-pbkdf2-example.js
var crypto = require('crypto');
// larger numbers mean better security, less
var config = {
// size of the generated hash
hashBytes: 32,
// larger salt means hashed passwords are more resistant to rainbow table, but
// you get diminishing returns pretty fast
saltBytes: 16,
// more iterations means an attacker has to take longer to brute force an
WebReflection / String.prototype.template.js
Last active Feb 17, 2019
ES6 Template like strings in ES3 compatible syntax.
View String.prototype.template.js
// this is now a module:
var template = require('backtick-template');
// just string
const info = 'template';
`some ${info}` === template('some ${info}', {info});
videlais / accelerometer.js
Created Dec 25, 2013
Complete Accelerometer.js code
View accelerometer.js
* An accelerometer object for detecting device orientation
* and motion (if supported)
* Chrome 7+, Firefox 6+, IE11+, iOS Safari 4.0+, Android Browser 3.0, Blackberry 10.0
* The DeviceOrientationEvent.alpha value represents the motion of the device around the z axis,
* represented in degrees with values ranging from 0 to 360.
hueniverse / gist:7686452
Last active Oct 2, 2019
Walmart Mobile node.js Setup
View gist:7686452


We run multiple server processes in two data centers. Each process listens on two ports, one for HTTP and one for HTTPS. HTTPS is terminated by Apache prior to reaching node.js. HTTP goes directly from the client to node.js (through a master load balancer). We do not use clusters. We slice our physical servers into thin virtual machines running SmartOS, each with about 3GB of memory designed for a single node.js process.

Our node.js servers are hapi.js servers using the composer functionality and plugins architecture. We have three sets of plugins loaded: mobile web front end experience (single page app), legacy API reverse proxy, and monitoring.

We also serve original node.js services off another server zone which runs closed source plugins using hapi.




  • C-a == Ctrl-a
  • M-a == Alt-a


:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
gordonbrander / ID.js
Created Mar 28, 2012
ID - a unique ID/name generator for JavaScript
View ID.js
// Generate unique IDs for use as pseudo-private/protected names.
// Similar in concept to
// <>.
// The goals of this function are twofold:
// * Provide a way to generate a string guaranteed to be unique when compared
// to other strings generated by this function.
// * Make the string complex enough that it is highly unlikely to be
// accidentally duplicated by hand (this is key if you're using `ID`
You can’t perform that action at this time.