Skip to content

Instantly share code, notes, and snippets.

View gitMatiH's full-sized avatar

Matías Alexander Hillmann gitMatiH

  • Buenos Aires, Argentina
View GitHub Profile
//Title: Button Debouncing using a State Machine
//Author: Chris Guichet
//Date: Jan 15, 2018
//
//Description:
// -A State Machine is a useful tool to organize complex code
// -Think of it like the next step beyone "If Else" statements
// -This example code uses a State Machine to handle tac switch debouncing
// -It also has a "Hold" function to enable interaction with long button presses
// -The tac switch is used to control a buzzer and an LED, it can multitask
//Title: Button Debouncing using a State Machine, Complex Version
//Author: Chris Guichet
//Date: Jan 15, 2018
//
//Description:
// -A State Machine is a useful tool to organize complex code
// -Think of it like the next step beyone "If Else" statements
// -This example code uses a State Machine to handle tac switch debouncing
// -It also has a "Hold" function to enable interaction with long button presses
//
@metakirby5
metakirby5 / pty.py
Last active September 28, 2022 12:47
How to simulate user input on an interpreter using a Python's pty module
import os, sys, subprocess, pty, select, re
BUFSIZ = 1024
MAGIC = '\004\004' # ctrl-D x2
escape = re.compile(r'(\x9B|\x1B\[)[0-?]*[ -\/]*[@-~]')
data = '\n'.join([
'1 + 1',
'2000',
'(function() {})',
@chanmix51
chanmix51 / tetrodes_pentodes.sub
Created October 12, 2013 08:20
LTSpice models for vacuum tubes
*--------------------------------------------------------------------------
* Model generated by Motega software:
*
* Modeling Of Tubes Employing Genetic Algorithms
*
* Models contain 1G resistors from all nodes to earth in order to avoid
* floating nodes. Triode and tetrode/pentode models contain a diode for
* simulating grid current.
*
* Non-commercial use is permitted, but at your own risk... This model
@robwierzbowski
robwierzbowski / gitcreate.sh
Last active December 27, 2024 11:23
A simple litte script. Create and push to a new github repo from the command line.
#!/bin/bash
# https://gist.github.com/robwierzbowski/5430952/
# Create and push to a new github repo from the command line.
# Grabs sensible defaults from the containing folder and `.gitconfig`.
# Refinements welcome.
# Gather constant vars
CURRENTDIR=${PWD##*/}
GITHUBUSER=$(git config github.user)