Skip to content

Instantly share code, notes, and snippets.

@hathawsh
hathawsh / encdec.py
Created August 3, 2012 19:24
Assymetric message encryption example
"""Message encryption/decryption with compression."""
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP
from Crypto.Signature import PKCS1_PSS
from Crypto.Hash import SHA
from base64 import urlsafe_b64encode
from base64 import urlsafe_b64decode
import zlib
@hathawsh
hathawsh / reram.py
Last active November 17, 2017 15:29
Alter Original Prusa i3 MMU tool changes to stop internal stringing
#!/usr/bin/env python
"""Alter Original Prusa i3 MMU tool changes to stop internal stringing.
This changes the filament unload procedure so that right after pulling out,
the extruder pauses (for a little cooling), pushes back in
(to compress the string), and pulls out again (to break the string.)
See: https://github.com/prusa3d/Slic3r/issues/396
"""
@hathawsh
hathawsh / keybase.md
Created September 19, 2019 17:42
keybase.md

Keybase proof

I hereby claim:

  • I am hathawsh on github.
  • I am hathawsh (https://keybase.io/hathawsh) on keybase.
  • I have a public key ASD3fWkhrwqCpOMjCSa1cSgwL8Uo8gi4McxMef6die0_HAo

To claim this, I am signing this object:

@hathawsh
hathawsh / entangle.py
Last active February 25, 2020 22:55
Experiment with quantum entanglement
import random
earth_total = 0
ship_total = 0
for particle in range(1000):
earth_result = random.random() >= 0.5
if earth_result:
ship_result = random.random() >= 0.6