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
mikeecb / comprehension_optimization_analysis.py
Created Apr 18, 2018
Analysis of Comprehension Optimization
View comprehension_optimization_analysis.py
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
mikeecb / optimize_comprehensions.py
Created Apr 17, 2018
Transforming Python ASTs to Optimize Comprehensions
View optimize_comprehensions.py
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
mikeecb / cryptopals_1_14_simplified.py
Created May 9, 2017
Cryptopals Challenge Set 2 Exercise 14 Simplified
View cryptopals_1_14_simplified.py
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
mikeecb / cryptopals_1_13.py
Last active May 8, 2017
Cryptopals Challenge 1 Set 13
View cryptopals_1_13.py
from Crypto.Cipher import AES
from random import randint
def aes_128_ecb_enc(buffer, key):
obj = AES.new(key, AES.MODE_ECB)
return bytearray(obj.encrypt(bytes(buffer)))
def aes_128_ecb_dec(buffer, key):
obj = AES.new(key, AES.MODE_ECB)
View keybase.md

Keybase proof

I hereby claim:

  • I am mikeecb on github.
  • I am mikeecb (https://keybase.io/mikeecb) on keybase.
  • I have a public key ASCGFsnMJRBB3ppbj-9Kcx0A1c4JmflTO-YbsxahJ19fOAo

To claim this, I am signing this object:

@mikeecb
mikeecb / github_contributions.py
Last active Aug 29, 2015
Get the number of contributions a user has done a day for the past year by scraping https://github.com/users/<USER>/contributions
View github_contributions.py
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.