This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import sdl2 | |
import sdl2.ext | |
import numpy as np | |
class Life(object): | |
def __init__(self, height, width): | |
self.width = width |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import time | |
import signal | |
import math | |
import scrollphathd | |
from envirophat import light, motion, weather | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess, time, sys | |
import numpy as np | |
from PIL import Image | |
class GraphicsDeviceBase(object): | |
def __init__(self, buf, depth): | |
self.__buf = buf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import unicornhathd | |
import datetime | |
import numpy as np | |
print("""Unicorn HAT HD: Rainbow | |
OMG MY EYES. | |
Press Ctrl+C to exit! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time, math, colorsys, random | |
from datetime import datetime, timedelta | |
from picamera import PiCamera | |
import numpy as np | |
import unicornhathd | |
unicornhathd.rotation(270) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.SUFFIXES: .pov .png | |
FINAL_IMAGES=block-bg-all.png block-spec-all.png block-spec-ext.png block-mask-inverted.png | |
PREVIEW_IMAGES=block-preview-render.png | |
TEMP_IMAGES=block-mask-inverted.png | |
TS=128 | |
all: $(FINAL_IMAGES) preview | |
dist: $(FINAL_IMAGES) dist-clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set up a python virtualenv: | |
virtualenv --system-site-packages -p python3 google-assistant-sdk | |
# enter the virtualenv: | |
source google-assistant-sdk/bin/activate | |
# install dependencies: | |
pip3 install google-assistant-sdk[auth_helpers]==0.1.0 grpc-google-cloud-speech-v1beta1==0.14.0 protobuf==3.1.0 | |
# the google code actually works out of the box on a default ubuntu install: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Finds colour replacements for an LDraw file. | |
# Usage: | |
# colourswap.py <LDraw file> <colour> [<rarity>] | |
# colour: an LDraw colour number, eg yellow = 14 | |
# rarity: pieces must be in at least this many sets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import http.server | |
import socketserver | |
from itertools import product | |
from subprocess import check_call, check_output | |
channels = 'ABCD' | |
ids = '1234' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#Connecting to: 08:7C:BE:8F:3C:FB, address type: public | |
#Service <uuid=Generic Attribute handleStart=12 handleEnd=15> : | |
# Characteristic <Service Changed>, hnd=0xd, supports READ INDICATE | |
# -> '\x01\x00\xff\xff' | |
#Service <uuid=Generic Access handleStart=1 handleEnd=11> : | |
# Characteristic <Device Name>, hnd=0x2, supports READ WRITE | |
# -> 'Quintic BLE' | |
# Characteristic <Appearance>, hnd=0x4, supports READ |