Skip to content

Instantly share code, notes, and snippets.

View triffid's full-sized avatar

Michael Moon triffid

View GitHub Profile
@triffid
triffid / bar-clamp.scad
Created March 5, 2012 11:53
Improved bar clamp for Prusa Mendel Reprap
wedge_width = 7.6;
m8_diam_tight = 8.2;
m8_diameter = 8.6;
wall_thickness = 3.3;
wedge_outer_angle = 2;
$fn=64;
module teardrop (r=8, h=20) {
@triffid
triffid / demo.txt
Created April 30, 2012 03:31
C++ USB for cortex-m3
USB u;
USBCDC uc;
USBMSC msc;
USBECM ecm;
UART dbg(UART0, 230400);
int main(void) {
dbg.send((uint8_t *) "start\n", 6);
@triffid
triffid / map.txt
Created May 24, 2012 10:26
netrap object model
Object Model for a netrap server, exposed via AJAX
server-server protocol may substitute a server object for TOP so tree-walk can be performed.
listPrintersWithCapabilities() is the major function to be implemented, this should also cause a broadcast amongst any server-server networks where all other functions are server-local
TOP
+- Printers[]
| +- Printer
| +- capabilities
@triffid
triffid / pymenu.py
Created June 18, 2012 13:16
python menu
import collections
def menu(items):
while 1:
for item in range(0, len(items)):
print "%d - %s" % (item + 1, items[item])
selection = raw_input("> ")
try:
selection = int(selection) + 1
if (selection >= 0) and (selection < len(items)):
@triffid
triffid / slic3r-machine-readable-options.sh
Created June 23, 2012 13:22
slic3r machine readable options
slic3r --help | perl -ne '/^\s+([A-Z].*?)\s+options.*?:$/ && do { if ($description) { print "\t\t$description\n"; $description = ""; } print "SECTION $1\n"; }; /^\s+((-\S,\s*)?--(\S+))(\s+(.*))/ && do { if ($description) { print "\t\t$description\n"; $description = ""; }; print "\tOPTION $3\n"; $description = " $5"; }; /^\s{24}(\S.*)/ && (length($description) != 0) && do { $description .= $1 }; END { print "\t\t$description\n"; }'
@triffid
triffid / scissormath.txt
Created July 17, 2012 12:18
scissor jack math
import math
### Input variables
# distance from end pin to center pin on scissor arm
c = 12
# minimum height, when arms are touching
a = 3
### calculated variables
@triffid
triffid / smoothie-crash-dump
Created November 1, 2012 12:47
Smoothie debugging
MSD:Got CBW 0x28 with datalength 4096
MSD: Read 8 blocks from LBA 121592
MSD:LBA 121592: 0 1 2 3 4 5 6 7
MSD:LBA 121593: 0 1 2 3 4 5 6 7
MSD:LBA 121594: 0 1 2 3 4 5 6 7
MSD:LBA 121595: 0 1 2 3 4 5 6 7
MSD:LBA 121596: 0 1 2 3 4 5 6 7
MSD:LBA 121597: 0 1 2 3 4 5 6 7
MSD:LBA 121598: 0 1 2 3 4 5 6 7
MSD:LBA 121599: 0 1 2 3 4 5 6 7
@triffid
triffid / namei.txt
Created November 4, 2012 00:17
apache permissions issue - namei output
# this link works perfectly
$ namei -m public_html/gallery/Pictures
f: public_html/gallery/Pictures
drwxr-xr-x public_html
drwxr-xr-x gallery
lrwxrwxrwx Pictures -> ../../Pictures
drwxr-xr-x ..
drwxr-xr-x ..
lrwxrwxrwx Pictures -> aleisa/Pictures
drwxr-xr-x aleisa
@triffid
triffid / lsusb
Created December 15, 2012 10:23
Smoothie DFU Bootloader descriptors
$ lsusb
Bus 001 Device 023: ID 1679:2001 Total Phase Beagle USB 12 Protocol Analyzer
Bus 002 Device 004: ID 0930:0508 Toshiba Corp. Integrated Bluetooth HCI
Bus 002 Device 003: ID 0483:2016 SGS Thomson Microelectronics Fingerprint Reader
Bus 003 Device 046: ID 1d50:6015 OpenMoko, Inc.
Bus 003 Device 122: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 004 Device 030: ID 046d:c404 Logitech, Inc. TrackMan Wheel
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
@triffid
triffid / main.elf
Created December 20, 2012 08:41
smoothie crash dump
This file has been truncated, but you can view the full file.