Skip to content

Instantly share code, notes, and snippets.

@curtmerrill
curtmerrill / main.py
Last active Aug 31, 2021
Neotrellis soundboard
View main.py
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 Mar 15, 2021
Basic editorconfig settings
View editorconfig
# 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 Jan 29, 2021
Coffee producing countries
View origins.py
# 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'),
View main.py
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 Nov 7, 2013
Markdown template tag for Django
View markdown_tag.py
# 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