Skip to content

Instantly share code, notes, and snippets.

@walkermatt
walkermatt / debounce.py
Created June 4, 2012 21:44
A debounce function decorator in Python similar to the one in underscore.js, tested with 2.7
from threading import Timer
def debounce(wait):
""" Decorator that will postpone a functions
execution until after wait seconds
have elapsed since the last time it was invoked. """
def decorator(fn):
def debounced(*args, **kwargs):
def call_it():
@hathawsh
hathawsh / reram.py
Last active November 17, 2017 15:29
Alter Original Prusa i3 MMU tool changes to stop internal stringing
#!/usr/bin/env python
"""Alter Original Prusa i3 MMU tool changes to stop internal stringing.
This changes the filament unload procedure so that right after pulling out,
the extruder pauses (for a little cooling), pushes back in
(to compress the string), and pulls out again (to break the string.)
See: https://github.com/prusa3d/Slic3r/issues/396
"""
@althonos
althonos / setup.cfg
Last active March 4, 2024 18:08
A `setup.cfg` template for my Python projects
# https://gist.github.com/althonos/6914b896789d3f2078d1e6237642c35c
[metadata]
name = {name}
version = file: {name}/_version.txt
author = Martin Larralde
author_email = martin.larralde@embl.de
url = https://github.com/althonos/{name}
description = {description}
long_description = file: README.md