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
vokeio / base.js
Last active Aug 29, 2019
Github Pages Base Tag Fix
View base.js
window.location.hostname.indexOf('') === -1 ? null : document.querySelector('base').href = '/' + window.location.pathname.split('/')[1] + '/';

Convert mp4 to webm

ffmpeg -i input.mp4 -vcodec libvpx -qmin 0 -qmax 50 -crf 10 -b:v 1M -acodec libvorbis output.webm

Convert webm to mp4

ffmpeg -i input.webm -vcodec libx264 output.mp4
vokeio /
Created Sep 5, 2018 — forked from nooges/
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
vokeio /
Created Aug 24, 2018 — forked from davestevens/
Let’s Encrypt setup for Apache, NGINX & Node.js

Let's Encrypt

Examples of getting certificates from Let's Encrypt working on Apache, NGINX and Node.js servers.

Obtain certificates

I chose to use the manual method, you have to make a file available to verify you own the domain. Follow the commands from running

git clone
cd letsencrypt
vokeio / client.js
Last active Aug 21, 2018 — forked from agrueneberg/client.html
HMAC Signature Verification
View client.js
const Http = require('http');
const Crypto = require('crypto');
const query = 'key=value';
const sharedSecret = 'secret';
const signature = Crypto.createHmac('sha256', sharedSecret).update(query).digest('hex');
port: 8000,
vokeio / encryption.js
Created Mar 8, 2018 — forked from vlucas/encryption.js
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 bytes (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', new Buffer(ENCRYPTION_KEY), iv);
View promise-async-each.js
function each (condition, method, context, index) {
index = index === undefined ? 0 : index;
if (, index)) {
return Promise.resolve().then(function () {
return, index);
}).then(each.bind(null, condition, method, context, index+1));
} else {
return Promise.resolve();
View test-object-loop.js
var object = {}, i = 0;
while (i++ < 100000) {
object['user' + i] = i;
// fastest
console.time('keys for');
var result;
var keys = Object.keys(object);
vokeio / umd.js
Created Feb 16, 2017
A better way then umd
View umd.js
var NAME = '';
var MODULE = {} || function () {};
(function (t, n, m) {
if (typeof m === 'function') m = m(t);
if (typeof t.define !== 'undefined') t.define([n], m);
else if (typeof t.module !== 'undefined') t.module.exports = m;
else if (typeof t.window !== 'undefined') t.window[n] = m;
else return m;
You can’t perform that action at this time.