This file contains hidden or 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 | |
| import sys | |
| f = sys.argv[1] | |
| openscad = 'openscad-nightly' | |
| result = subprocess.check_output([openscad, '--export-format', 'echo', '-o', '-', f]) | |
| exported = set() |
This file contains hidden or 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
| from evdev import UInput, ecodes as e | |
| import time | |
| cap = { | |
| # we have to have some buttons and X, Y otherwise | |
| # xfce doesn't recognize it as a mouse | |
| e.EV_KEY: [e.BTN_LEFT, e.BTN_RIGHT], | |
| e.EV_REL: [e.REL_X, e.REL_Y, e.REL_WHEEL, e.REL_WHEEL_HI_RES], | |
| } |
This file contains hidden or 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
| module spring(width, id, od, count) { | |
| for(i = [0 : count]) { | |
| translate([-width/2, i*(od+id)]) square([width, od-id]); | |
| if (i < count) { | |
| mirror([i%2, 0, 0]) | |
| translate([-width/2, (i*(od+id))+(od)]) | |
| difference() { | |
| circle(od); | |
| circle(id); | |
| translate([0, -od*1.5]) square(od*3); |
This file contains hidden or 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 | |
| # BB-8 Python driver by Alistair Buxton <a.j.buxton@gmail.com> | |
| from bluepy import btle | |
| import time | |
| class BB8(btle.DefaultDelegate): | |
| def __init__(self, deviceAddress): |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
NewerOlder