Skip to content

Instantly share code, notes, and snippets.

const {
draw,
drawCircle,
drawRectangle,
importSTL,
} = replicad;
const defaultParams = {
layerHeight: 0.2,
import _thread
import asyncio
import requests
class ThreadSafeTask:
def __init__(self):
self._task: ThreadedTask | None = None
self._put_event = asyncio.ThreadSafeFlag() # Triggered by put, tested by get
@North101
North101 / bleedy.py
Last active December 5, 2024 22:06
import argparse
import pathlib
from itertools import chain
from PIL import Image
def main(
path: pathlib.Path,
bleed: int,
import 'dart:async';
import 'package:collection/collection.dart';
import 'package:drift/drift.dart';
import 'package:rxdart/rxdart.dart';
abstract class BasePaginatedList<T> {
BasePaginatedList(this.pageCount) {
_sink.doOnDone(() => _sub?.cancel());
}
@North101
North101 / button_test.py
Last active July 19, 2022 19:25
badger2040 button polling
import io
import os
import select
import struct
from typing import Callable
import badger2040
import machine
display = badger2040.Badger2040()
@North101
North101 / arkhamhorror.json
Created September 6, 2020 13:10
Calculate AH cards
This file has been truncated, but you can view the full file.
[{"pack_code":"core","pack_name":"Core Set","type_code":"treachery","type_name":"Treachery","subtype_code":"basicweakness","subtype_name":"Basic Weakness","faction_code":"neutral","faction_name":"Neutral","position":1000,"exceptional":false,"myriad":false,"code":"01000","name":"Random Basic Weakness","real_name":"Random Basic Weakness","text":"This is a placeholder random basic weakness\n You can replace it with a specific weakness using the Special tab or click the random button to replace it with a random weakness from your collection.","real_text":"This is a placeholder random basic weakness\n You can replace it with a specific weakness using the Special tab or click the random button to replace it with a random weakness from your collection.","quantity":1,"clues_fixed":false,"health_per_investigator":false,"deck_limit":1,"real_slot":"","traits":"","real_traits":"","is_unique":false,"exile":false,"hidden":true,"permanent":false,"double_sided":false,"url":"https:\/\/arkhamdb.com\/card\/01000"},{"pack_code":
{
"The Gathering": "Core Set",
"The Midnight Masks": "Core Set",
"Cult of Umôrdhoth": "Core Set",
"The Devourer Below": "Core Set",
"Rats": "Core Set",
"Ghouls": "Core Set",
"Striking Fear": "Core Set",
"Ancient Evils": "Core Set",
"Chilling Cold": "Core Set",
library rxdart_combinelatesttuple;
import 'package:rxdart/rxdart.dart';
import 'package:tuple/tuple.dart';
extension CombineLatestStreamTuple on CombineLatestStream {
static CombineLatestStream<dynamic, Tuple2<A, B>> tuple2<A, B>(
Stream<A> streamA,
Stream<B> streamB,
) {
import random
import statistics
import json
import collections
import csv
class CardStack(collections.UserList):
_sum = None