Skip to content

Instantly share code, notes, and snippets.

View markph0204's full-sized avatar

Mark Hurley markph0204

View GitHub Profile
@markph0204
markph0204 / py37-plugins-example
Created June 28, 2018 10:47
Python 3.7 Plugins
from importlib import import_module
from importlib import resources
PLUGINS = dict()
def register_plugin(func):
"""Decorator to register plug-ins"""
name = func.__name__
PLUGINS[name] = func
return func
@markph0204
markph0204 / gist:d2999b0b947b49bc0c0b5f2c73e2437c
Last active March 18, 2023 02:56
Creality CR-10S Print Head Clean GCode
; Pefix G-Code for Creality CR-10 by www.DIY3DTech.com to clean nozzle
; Place as start G-Code in Slicer
; Use of this code is at your own risk (no warranties made or implied)
;
M117 Clean ; Indicate nozzle clean in progress on LCD
M109 S200 ; Uncomment to set your own temp [run warmer to clean out nozzle]
M107 ; Turn layer fan off
G21 ; Set to metric [change to G20 if you want Imperial]
G90 ; Force coordinates to be absolute relative to the origin
G28 ; Home X/Y/Z axis
@markph0204
markph0204 / pygame_mac_latest.sh
Last active December 24, 2018 14:04
Python 3 + VirtualEnv + HighSierra + Pygame 1.9.x (Dev-Dec21) + Xcode 10.1 + Homebrew
# Python 3 + VirtualEnv + HighSierra + Pygame 1.9.x (Dev-Dec21) + Xcode 10.1 + Homebrew
# https://www.pygame.org/wiki/MacCompile
# 1. Install <a href="https://brew.sh">Homebrew</a> -- instructions found here.
# 2. Install XQuartz:
brew install Caskroom/cask/xquartz
# 3. Install Python 3.7.x
brew install python3
@markph0204
markph0204 / fullscreen_pygame_test.py
Created September 9, 2019 15:48
Pygame Fullscreen test
import pygame
pygame.init()
pygame.display.set_mode((640, 480))
modes = pygame.display.list_modes()
# pygame.display.set_mode(modes[0], pygame.FULLSCREEN)
FULLSCREEN = False
notdone = True
while notdone: