Skip to content

Instantly share code, notes, and snippets.

View brunocassol's full-sized avatar

Bruno Cassol brunocassol

View GitHub Profile
@brunocassol
brunocassol / redisjobqueue.go
Created March 11, 2017 08:03
A simple demo implementation of a Redis job queue in Go inspired on http://stackoverflow.com/a/34754632
package main
// A simple demo implementation of a Redis job queue in Go inspired on http://stackoverflow.com/a/34754632
// You'll need to get redis driver package in terminal with: go get -u gopkg.in/redis.v5
// Once it is running, Redis should look like: http://i.imgur.com/P4XlwlP.png
// Terminal should look like: http://i.imgur.com/AS2IIbP.png
// I have 4 days of Go programming experience, have mercy.
import (
"fmt"
javascript:function lpCreatePass(length,upper,lower,digits,special,mindigits,ambig,reqevery){if(typeof(length)=="undefined"){length=8+get_random(0,1);}if(length>256){length=256;}if(mindigits>256){mindigits=256;}if(typeof(upper)=="undefined"){upper=true;}if(typeof(lower)=="undefined"){lower=true;}if(typeof(digits)=="undefined"){digits=true;}if(typeof(special)=="undefined"){special=false;}if(typeof(mindigits)=="undefined"){mindigits=0;}if(typeof(ambig)=="undefined"){ambig=false;}if(typeof(reqevery)=="undefined"){reqevery=true;}var minlower=0;var minupper=0;var minspecial=0;if(reqevery){minlower=minupper=minspecial=1;}var positions=new Array();if(lower&&minlower>0){for(var i=0;i<minlower;i++){positions[positions.length]="L";}}if(upper&&minupper>0){for(var i=0;i<minupper;i++){positions[positions.length]="U";}}if(digits&&mindigits>0){for(var i=0;i<mindigits;i++){positions[positions.length]="D";}}if(special&&minspecial>0){for(var i=0;i<minspecial;i++){positions[positions.length]="S";}}while(positions.length<length)
// by: throw_away_stacy on reddit
// and yes I do birthday parties too
const WebSocket = require('websocket').w3cwebsocket;
const users = require('./users.json');
const Q = require('q');
const superagent = require('superagent');
const _ = require('highland');
const getPixels = require('get-pixels');