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]; |
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
@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. |
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 | |
from collections import defaultdict | |
from itertools import combinations, permutations | |
from math import isqrt | |
from subprocess import check_call | |
def inner(n): | |
return range(1, n+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
bl_info = { | |
"name": "Infinite Backups", | |
"author": "Alistair Buxton <[email protected]>", | |
"version": (1, 0), | |
"blender": (2, 80, 0), | |
"doc_url": "https://gist.github.com/ali1234/415c5ac863c5649c41a22fe061351a22", | |
"tracker_url": "https://gist.github.com/ali1234/415c5ac863c5649c41a22fe061351a22", | |
"category": "System", | |
} |
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
// [ 56.0, 4*62.0, 48.0, 0.6 ], // WHAM 5.04 outer side large | |
// [ 56.0, 2*62.0, 48.0, 0.6 ], // WHAM 5.04 outer side small | |
// [ 56.5, 63.5, 48.0, 0.6 ], // WHAM 5.04 inner | |
// [ 56.5, 62.5, 48.0, 0.6, [0.125, 0.5, 0.25, 0.125] ], // WHAM 5.04 outer | |
$fs = 0.1; | |
module fillet(r) { |
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
// hpp | |
#pragma once | |
#include <cstdint> | |
#include "32blit.hpp" | |
enum Sound { | |
BlockSmash, |
NewerOlder