Skip to content

Instantly share code, notes, and snippets.

View ahirner's full-sized avatar

Alexander Hirner ahirner

View GitHub Profile
@ahirner
ahirner / unfederate.rs
Created October 27, 2025 20:49
WIP to pull up unsupported nodes/functions from federated queries
use std::sync::Arc;
use datafusion::{
common::{
tree_node::{Transformed, TreeNode, TreeNodeRecursion},
Result as DFResult,
},
error::DataFusionError,
logical_expr::{
Expr, Extension, Filter, Limit, LogicalPlan, Projection, Sort, Unnest as LEUnnest,
@ahirner
ahirner / uuid2ulid.eql
Last active April 28, 2024 19:38
Convert ULIDs to UUIDs in edgedb QL (v4)
# this works around some limitations in bigint arithmetic and conversion functions in v4
# use at your own risk!
select ((for uguids in array_unpack([
("01HWJ34TFNC07RS01E8RZ6ZM90","018F2432-69F5-600F-8C80-2E463E6FD120"),
("01HW2C1NDSTMNVE24N9ZBPMXZQ","018F04C0-D5B9-D52B-B708-954FD76A77F7"),
("01HWJ34TFNC07RS01E8RZ6ZM90","018F2432-69F5-600F-8C80-2E463E6FD120"),
("6B53DA8QCX8QC8BBPKS2T4PYZF","CB28DAA4-5D9D-45D8-85AE-D3C8B44B7BEF"),
("2T3GMC529H81TSSS1F7RVSCF03","5A1C28C2-8931-4075-9CE4-2F3E37963C03"),
("1MKKCZ0G8D8NHRPRYDTG4B0B17","349CD9F0-410D-4563-8B63-CDD408B02C27"),
("7BNVAYXYBM8JGSHN421T6KXFS6","EBAED5EE-F974-44A1-98D4-820E8D3EBF26"),
@ahirner
ahirner / prf.py
Created April 24, 2020 22:32
prefect flow pruning
import random
from datetime import timedelta
from typing import Set, Iterable
import prefect
from prefect import task, Flow, Task, Parameter
from prefect.engine.cache_validators import duration_only, all_inputs
from prefect.tasks.core.constants import Constant
@ahirner
ahirner / entity.rs
Created April 13, 2020 11:44
nphysics2d + nannou
use crate::geometry::CommonPoint2;
use crate::render::Nannou;
use nalgebra::Isometry2;
use nannou::color::IntoLinSrgba;
use nannou::draw::properties::SetColor;
use nannou::prelude::*;
use ncollide2d::shape::{ConvexPolygon, Cuboid, Polyline, ShapeHandle};
use nphysics2d::object::{
BodyPartHandle, ColliderDesc, DefaultBodyHandle, DefaultBodySet, DefaultColliderHandle,
DefaultColliderSet, Ground, RigidBody, RigidBodyDesc,