Skip to content

Instantly share code, notes, and snippets.

View MiCurry's full-sized avatar

Miles Curry MiCurry

View GitHub Profile
@MiCurry
MiCurry / bitCmp.py
Created November 14, 2017 19:46
Compare two one line files bit by bit
import os
import argparse
def tobits(s):
result = []
for c in s:
bits = bin(ord(c))[2:]
bits = '00000000'[len(bits):] + bits
result.extend([int(b) for b in bits])
return result
@MiCurry
MiCurry / randomString.py
Created November 14, 2017 00:56
Generate a random string to std out of a specficied size
# Generates a random string of length k to std out
import argparse
import string
import random
def id_generator(size, chars=string.ascii_uppercase \
+ string.digits \
+ string.ascii_lowercase):
return ''.join(random.choice(chars) for _ in range(size))
@MiCurry
MiCurry / argParser.py
Last active April 16, 2024 19:14
ArgParser Example
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Easy way to produce plots of\
3D vector fields in python.')
parser.add_argument('task',
help='task name',
type=str)
parser.add_argument("-f", '--fileNameTag',
help='Appends it to the end of a filename so it can be unique when you plot it',