Skip to content

Instantly share code, notes, and snippets.

View candu's full-sized avatar

Evan Savage candu

View GitHub Profile
@candu
candu / bumpme
Last active May 1, 2019 20:38
Concourse CI test
Wed May 1 20:38:35 UTC 2019
@candu
candu / generalized_birthday_problem.py
Last active August 29, 2015 14:20
Generalized Birthday Problem
import sys
import math
n = int(sys.argv[1]) # n is the number of people
M = int(sys.argv[2]) # M is the number of matching birthdays
m = int(sys.argv[3]) # m is the number of days in the year
def logFact(n):
"""
Compute log(n!)
@candu
candu / lipsum
Created November 7, 2014 18:13
Command-line Lorem Ipsum generator using curl, lipsum.com, and jq
#!/bin/sh
AMOUNT=5
WHAT=paras
START=false
while getopts ":n:wpbls" opt; do
case $opt in
n)
AMOUNT=$OPTARG
Whois Server Version 2.0
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.
Domain Name: MARTHA-ROBERTSON.COM
Registrar: GODADDY.COM, LLC
Whois Server: whois.godaddy.com
@candu
candu / racer.py
Created May 25, 2013 04:21
Brute-forcing Racer Chrome experiment codes. (Unfortunately, the chance of getting a valid code is pretty small.)
import json
import string
import urllib
import sys
import random
chars = string.uppercase
while True:
s = ''.join(random.choice(chars) for i in range(5))
try: