Skip to content

Instantly share code, notes, and snippets.

View adammhaile's full-sized avatar

Adam Haile adammhaile

View GitHub Profile
@adammhaile
adammhaile / config.h
Created September 2, 2019 22:48
grbl
/*
config.h - compile time configuration
Part of Grbl
Copyright (c) 2012-2016 Sungeun K. Jeon for Gnea Research LLC
Copyright (c) 2009-2011 Simen Svale Skogsrud
Grbl is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
def rmdir(path, recursive=True):
for f in os.listdir(path):
fu = os.path.join(path, f)
if os.path.isfile(file_path):
os.unlink(file_path)
elif recursive and os.path.isdir(file_path):
shutil.rmtree(file_path)
from random import randint
import time
class Jewels:
def __init__(self):
self.matrix = [[randint(0, 5) for x in range(16)] for y in range(16)]
self._reset_visited()
def _reset_visited(self):
self.__visited = [[False for x in range(16)] for y in range(16)]
import numpy
import scipy.signal
import pygame, pygame.sndarray
def play_for(sample_wave, ms):
"""Play the given NumPy array, as a sound, for ms milliseconds."""
sound = pygame.sndarray.make_sound(sample_wave)
sound.play(-1)
from __future__ import print_function
import sys
from bibliopixel.drivers.serial_driver import DriverSerial
ports = DriverSerial.findSerialDevices(hardwareID="16C0:0483")
for p in ports:
i = DriverSerial.getDeviceID(p)
print('{} -> {}'.format(p, i))
from __future__ import print_function, division
BASE_SCRIPT = """
S{power}
G90
G0 X{x} Y{y} F12000
G91
G1 X10 F500
2018-01-29 23:16:19,962 - octoprint.server - INFO - --- Log roll over detected ---------------------------------------------------
2018-01-29 23:16:19,962 - octoprint.server - INFO - OctoPrint 1.3.6
2018-01-29 23:16:19,965 - octoprint.plugin.core - INFO - 15 plugin(s) registered with the system:
| Announcement Plugin (bundled) = /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.6-py2.7.egg/octoprint/plugins/announcements
| BLTouch Plugin (0.2.0) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_BLTouch
| Core Wizard (bundled) = /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.6-py2.7.egg/octoprint/plugins/corewizard
| CuraEngine (<= 15.04) (bundled) = /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.6-py2.7.egg/octoprint/plugins/cura
| Discovery (bundled) = /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.6-py2.7.egg/octoprint/plugins/discovery
| Display ETA (1.0.2) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_eta
| EEPROM Marlin Editor Pl
@adammhaile
adammhaile / octoprint.log
Created December 1, 2017 23:15
OctoPrint WebCam Failing
2017-11-30 03:49:05,907 - octoprint.server - INFO - --- Log roll over detected ---------------------------------------------------
2017-11-30 03:49:05,907 - octoprint.server - INFO - OctoPrint 1.3.5 (master branch)
2017-11-30 03:49:05,911 - octoprint.plugin.core - INFO - 16 plugin(s) registered with the system:
| Announcement Plugin (bundled) = /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.5-py2.7.egg/octoprint/plugins/announcements
| BLTouch Plugin (0.2.0) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_BLTouch
| Core Wizard (bundled) = /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.5-py2.7.egg/octoprint/plugins/corewizard
| CuraEngine (<= 15.04) (bundled) = /home/pi/oprint/lib/python2.7/site-packages/OctoPrint-1.3.5-py2.7.egg/octoprint/plugins/cura
| Custom Control Editor (0.2.1) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_customControl
| Cyborg Theme (0.1.6) = /home/pi/oprint/local/lib/python2.7/site-packages/octoprint_cyborgtheme
| Discovery (b
@adammhaile
adammhaile / dual.gcode
Created November 8, 2017 00:17
dual extrusion Z wrong
; G-Code generated by Simplify3D(R) Version 4.0.0
; Nov 7, 2017 at 5:51:16 PM
; Settings Summary
; processName,Color1
; applyToModels,Calibration_Target_A_v1-1
; profileName,T-Rex 2+ Dual (modified)
; profileVersion,2017-11-07 17:05:51
; baseProfile,Formbot T-Rex 2 (modified)
; printMaterial,PLA
; printQuality,High
from bibliopixel.drivers.driver_base import DriverBase
import time
import struct
import os
from PIL import Image
import numpy
from skvideo.io import FFmpegWriter
import scipy.misc