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
// Animation showing what the 4x offset rounding trick does. | |
$fs = 0.1; | |
$fa = 0.1; | |
function clamp(x) = min(max(x, 0), 1); | |
module timed_offset(t) { | |
a = clamp(t-1); |
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
/* | |
Keyboard data | |
*/ | |
row_space = 2.1; | |
key_space = 1.8; | |
surround = 0.6; | |
key_colour = [0.1, 0.1, 0.1]; | |
shell_colour = [0.5, 0.5, 0.5]; |
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 sys | |
try: | |
import bpy | |
except ImportError: | |
print('Running myself inside Blender') | |
import subprocess | |
exit(subprocess.call(['blender', '--background', '--python', __file__, '--'] + sys.argv)) |
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 fcntl | |
import termios | |
import sys | |
import os | |
import time | |
class NonBlockingInput(object): | |
def __enter__(self): |
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 2 columns, instead of 3. in line 2.
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
2, 2 | |
3, 3 | |
4, 2, 2 | |
5, 5 | |
6, 2, 3 | |
7, 7 | |
8, 2, 2, 2 | |
9, 3, 3 | |
10, 2, 5 | |
11, 11 |
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 |
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
@click.group(invoke_without_command=True, no_args_is_help=True) | |
@click.version_option() | |
@click.help_option() | |
@click.option('--help-all', is_flag=True, help='Show help for all subcommands.') | |
@click.pass_context | |
def yourcommand(ctx, help_all): | |
"""This group will print all help pages for subcommands.""" | |
if help_all: | |
print(yourcommand.get_help(ctx)) |
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
# https://github.com/going-digital/Talkie ported to Python | |
import queue | |
import random | |
import numpy as np | |
class BitReader: | |
def __init__(self, data): |
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
Convexity | |
--------- | |
Explanation for mathematicians: | |
1. Every object in OpenSCAD must be closed. An object is closed if it partitions space into two regions: | |
"inside" (the object itself) and "outside" (the rest of the empty space that the object does not occupy). | |
For the purposes of understanding convextity, we can ignore positions that lie exactly on the object's surface, | |
and say that any arbitrarily selected position in space must be either inside or outside the object - never both. |
NewerOlder