Skip to content

Instantly share code, notes, and snippets.

000.png (transparent)

000

001.png (no shadow)

001

002.png (complete)

use std::sync::mpsc;
use std::{thread, time};
struct Guard {
tx: mpsc::SyncSender<bool>,
}
impl Drop for Guard {
fn drop(&mut self) {
println!("in drop about to send");
require 'openssl'
require 'base64'
key = OpenSSL::PKey.read File.read 'dev.key'
puts key.verify nil, Base64.urlsafe_decode64("MCHUTLtnvaAJSv6wwZgvfLIXQYWXH-KH8hygHX1xQ18E5H9GNAWoGqNwyeNSkEsMCLldG0LfL7OZwY3tvTd5CQ=="), "rez:1744330731"
@rectalogic
rectalogic / sqlite_vec.rs
Created March 12, 2025 19:53
sqlite-vec with rusqlite
use rusqlite::{
Connection, Result,
auto_extension::{RawAutoExtension, register_auto_extension},
};
use sqlite_vec::sqlite3_vec_init;
use zerocopy::IntoBytes;
#[cfg(test)]
mod tests {
use super::*;
struct Value(Formattable):
var value: Float64
fn __init__(inout self, value: Float64):
self.value = value
fn format_to(self, inout writer: Formatter):
writer.write("Value(", self.value, ")")
def main():
v = Value(33)

imageim clock

@rectalogic
rectalogic / Animation.ts
Created May 31, 2024 20:11
animation interpolation code for posterity
// Copyright (C) 2024 Andrew Wason
// SPDX-License-Identifier: MIT
import * as D from 'decoders';
export namespace Animation {
export type Properties<P> = {
[Property in keyof P]?: number;
};
@rectalogic
rectalogic / asbury-park-happy-hour.md
Last active April 21, 2024 15:45
Asbury Park Happy Hours
from __future__ import annotations
import typing as ta
# https://stackoverflow.com/questions/64161037/how-can-i-use-mypy-to-overload-the-init-method-to-adjust-a-getters-return-v
T = ta.TypeVar("T", covariant=True)
RT = ta.TypeVar("RT")
from fhir.resources import fhirtypes, reference, patient, organization, humanname
org = organization.Organization(
id="org1",
active=True,
name="Acme Corp",
)
patient = patient.Patient(
id="p001",
active=True,