Skip to content

Instantly share code, notes, and snippets.

Michael Cypher mikeecb

Block or report user

Report or block mikeecb

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
mikeecb /
Created Apr 18, 2018
Analysis of Comprehension Optimization
from optimize_comprehensions import optimize_comprehensions
import numpy as np
import matplotlib.pyplot as plt
import timeit
from functools import partial
from time import sleep
def list_comprehension(expensive_func):
mikeecb /
Created Apr 17, 2018
Transforming Python ASTs to Optimize Comprehensions
import inspect
from ast import comprehension [136/153]
from ast import dump
from ast import fix_missing_locations
from ast import parse
from ast import List
from ast import Load
from ast import DictComp
from ast import GeneratorExp
from ast import SetComp
mikeecb /
Created May 9, 2017
Cryptopals Challenge Set 2 Exercise 14 Simplified
from Crypto.Cipher import AES
from random import randint
from collections import defaultdict
def repeated_blocks(buffer, block_length=16):
reps = defaultdict(lambda: -1)
for i in range(0, len(buffer), block_length):
block = bytes(buffer[i:i + block_length])
reps[block] += 1
return sum(reps.values())
mikeecb /
Last active May 8, 2017
Cryptopals Challenge 1 Set 13
from Crypto.Cipher import AES
from random import randint
def aes_128_ecb_enc(buffer, key):
obj =, AES.MODE_ECB)
return bytearray(obj.encrypt(bytes(buffer)))
def aes_128_ecb_dec(buffer, key):
obj =, AES.MODE_ECB)

Keybase proof

I hereby claim:

  • I am mikeecb on github.
  • I am mikeecb ( on keybase.
  • I have a public key ASCGFsnMJRBB3ppbj-9Kcx0A1c4JmflTO-YbsxahJ19fOAo

To claim this, I am signing this object:

mikeecb /
Last active Aug 29, 2015
Get the number of contributions a user has done a day for the past year by scraping<USER>/contributions
import urllib
import json
from datetime import datetime
# Pass a username such as "mikeecb"
# Returns a list of tuples in the form (contributions, datetime_obects)
def github_contributions_to_dates(username):
contributions_to_dates = []
You can’t perform that action at this time.