Skip to content

Instantly share code, notes, and snippets.

@curtmerrill
curtmerrill / main.py
Last active August 31, 2021 17:05
Neotrellis soundboard
import adafruit_imageload
import audioio
import audiocore
import board
import busio
import digitalio
import displayio
import os
import random
import time
@curtmerrill
curtmerrill / editorconfig
Created March 15, 2021 19:35
Basic editorconfig settings
# editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
@curtmerrill
curtmerrill / origins.py
Created January 29, 2021 20:38
Coffee producing countries
# Country codes and their corresponding flag emoji and names for coffee producing countries
# Source: https://en.wikipedia.org/wiki/List_of_countries_by_coffee_production
ORIGINS = (
('xx', '🇺🇳 Blend'),
('ao', '🇦🇴 Angola'),
('bo', '🇧🇴 Bolivia'),
('br', '🇧🇷 Brazil'),
('bi', '🇧🇮 Burundi'),
('cm', '🇨🇲 Cameroon'),
@curtmerrill
curtmerrill / main.py
Created November 7, 2020 14:13
Busy box Mk.I
import board
import neopixel
import time
from adafruit_debouncer import Debouncer
from digitalio import DigitalInOut, Direction, Pull
from random import randint
# Built in red LED
led = DigitalInOut(board.D13)
@curtmerrill
curtmerrill / markdown_tag.py
Created November 7, 2013 15:48
Markdown template tag for Django
# Creates a template tag so you can use Markdown in textfields
#
# REQUIRES:
# - markdown 2 -- pip install markdown2
#
# USAGE:
# - Create a folder in your app called "templatetags"
# - Save this file and an __init__.py in the folder
# - In your template, add "{% load markdown_tag %}" at top
# - {{ field|md }} will output escaped markup