Skip to content

Instantly share code, notes, and snippets.

hathawsh /
Last active Feb 25, 2020
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

Keybase proof

I hereby claim:

  • I am hathawsh on github.
  • I am hathawsh ( on keybase.
  • I have a public key ASD3fWkhrwqCpOMjCSa1cSgwL8Uo8gi4McxMef6die0_HAo

To claim this, I am signing this object:

hathawsh /
Last active Nov 17, 2017
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.)
hathawsh /
Created Aug 3, 2012
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