Skip to content

Instantly share code, notes, and snippets.

View ryansturmer's full-sized avatar

Ryan Sturmer ryansturmer

View GitHub Profile
g2: --C-1419786268906----> {"qr":null} [g2]
g2: <-C--1419786268919---- {"r":{"qr":28},"f":[1,0,11]} [g2]
g2: --G-1419786268923----> N2G17
N3G0 Z1
N4G0 X0 Y0
N5M4
N6M8
N7G4 P3.0
N8G1 Z-0.125 F90
N9G1 X11.8750 F90
{
"gun": 0,
"gco": 2,
"1ma": 0,
"2ma": 1,
"3ma": 2,
"4ma": 3,
"5ma": 4,
"6ma": 5,
"1sa": 1.8,
@ryansturmer
ryansturmer / 6_inch_xaxis.nc
Created November 20, 2014 21:30
A 6 inch single axis move, split into 0.010" segments (2 inches per second)
G1 X0 F120
G1 X0.01 F120
G1 X0.02 F120
G1 X0.03 F120
G1 X0.04 F120
G1 X0.05 F120
G1 X0.06 F120
G1 X0.07 F120
G1 X0.08 F120
G1 X0.09 F120
@ryansturmer
ryansturmer / arc_segments.nc
Created November 18, 2014 03:19
G-Code Arc Segments
G17
G0Z1.5000
G0X0.0000Y0.0000S14000
G0X2.0106Y3.4058Z0.2362F240.0
G1Z-0.2000F60.0
G2X1.5106Y3.9058I0.0000J0.5000F120.0
G2X2.0106Y4.4058I0.5000J0.0000F120.0
G2X2.5106Y3.9058I0.0000J-0.5000F120.0
G2X2.0106Y3.4058I-0.5000J0.0000F120.0
G0Z0.2362F240.0
@ryansturmer
ryansturmer / segmented_circle.nc
Last active August 29, 2015 14:09
G-Code Segmented Circle
G17
G0Z1.5000
G0X0.0000Y0.0000S14000
G0X2.0106Y3.4058Z0.2362F240.0
G1Z-0.2000F60.0
G1X1.9993Y3.4059F120.0
G1X1.9879Y3.4063F120.0
G1X1.9765Y3.4069F120.0
G1X1.9649Y3.4079F120.0
G1X1.9533Y3.4091F120.0
@ryansturmer
ryansturmer / surface.sbp
Created August 29, 2014 04:17
Table Surfacing Routine
&XAREA = 22.5
&ZDEPTH = -0.125
&YAREA = 17
&ZCLEAR = 1.0
&STEPOVER = 0.4
&SPEED = 1.0
C6
PAUSE 3
@ryansturmer
ryansturmer / hg_cheat_sheet.md
Last active August 29, 2015 14:02
Mercurial Cheat Sheet

Mercurial (hg) Cheat Sheet

The purpose of this document is to provide quick reference to the often-used commands of mercurial (hg).

Branches

List all branches

hg branches
@ryansturmer
ryansturmer / bbb-make-sdcard.sh
Last active August 29, 2015 14:02
Beaglebone Black SD Card Builder
#!/bin/sh
# This is a script for making a beaglebone SD card
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
read -p "This will obliterate the partition table on $1... Are you sure? (y/n)" -n 1 -r
#!/usr/bin/env python
#coding:utf-8
# Purpose: Export 3D objects, build of faces with 3 or 4 vertices, as ASCII or Binary STL file.
# License: MIT License
import struct
ASCII_FACET = """facet normal 0 0 0
outer loop
vertex {face[0][0]:.4f} {face[0][1]:.4f} {face[0][2]:.4f}
@ryansturmer
ryansturmer / midi.py
Last active December 17, 2015 14:29
Some functions for dealing with MIDI and music data. Can't say how many times I've re-written these over the years. Bonus demo function written using pygame (poll a midi input device and print events to the console)
NOTES_SHARP = ["C", "C#", "D", "D#", "E", "F", "F#", "G","G#", "A","A#","B"]
NOTES_FLAT = ["C", "Db", "D", "Eb", "E", "F", "Gb", "G","Ab", "A","Bb","B"]
def generate_midi_event_map():
events = ['Note Off',
'Note On',
'Polyphonic Aftertouch',
'Control Mode Change',
'Program Change',
'Channel Aftertouch',