Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
from PyQt4 import QtCore, QtWebKit, QtGui
import sys
import random
app = QtGui.QApplication(sys.argv)
window = QtGui.QWidget()
layout = QtGui.QVBoxLayout(window)
@tdfischer
tdfischer / makekey.py
Last active January 5, 2024 06:54
Schalge 5 Cylinder Key Generator https://noisebridge.net/wiki/Key_Milling
#!/usr/bin/env python
# makekey.py - A key making tool
# This program will accept a pin configuration for a Schalge 5 Pin lock and produce GCode to mill out the corresponding key.
#
# For example, this will produce a bump key:
# $ ./makekey.py 99999
#
# This could produce a key to something else:
# $ ./makekey.py 38457
#
@tdfischer
tdfischer / gist:8214080
Created January 2, 2014 02:23
key cutter
#!/usr/bin/env python
import sys
keyPIN = str(int(sys.argv[1]))
print """
G94 ( use inches/min feed rate)
G20 ( use inches for coordinates )
G90 ( absolute coordinates )
G64 P0.00500 ( maximum deviation )
@tdfischer
tdfischer / gist:4082680
Created November 16, 2012 00:16
generate imap message ranges from a list of ints
msgRanges = []
num = iter(sorted(numbers))
startNum = None
lastNum = None
try:
while True:
curNum = num.next()
if startNum is None:
startNum = curNum
lastNum = curNum