Skip to content

Instantly share code, notes, and snippets.

View tomachalek's full-sized avatar

Tomas Machalek tomachalek

View GitHub Profile
@tomachalek
tomachalek / gist:6206674
Last active December 20, 2015 22:39
Run your tasks asynchronously and do some work when all is done.
(function (exports) {
'use strict';
/**
*
* @constructor
*/
function DoAll() {
this.actions = [];
this.confirms = [];
@tomachalek
tomachalek / gist:6122926
Last active December 20, 2015 11:19
URL shortener (based on md5 alg.)
# an URL shortener
from hashlib import md5
chars = (
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
)