Skip to content

Instantly share code, notes, and snippets.

View hallundbaek's full-sized avatar

Tobias H. Petersen hallundbaek

View GitHub Profile
@hallundbaek
hallundbaek / FreeCAD-1.0rc1.nix
Last active October 5, 2024 16:42
A first attempt at creating a override for trying out the new FreeCAD 1.0rc1 on NixOS. Ideally the gtest should probably use the one from nixpkgs, but that resulted in issues that were easier solved by simply pulling the repo directly. Same goes for OndselSolver which should probably be its own package, alas I didn't do that.
pkgs.freecad.overrideAttrs (
final: prev: {
version = "1.0rc1";
src = pkgs.fetchFromGitHub {
owner = "FreeCAD";
repo = "FreeCAD";
rev = "1.0rc1";
hash = "sha256-bhRqWjYtwQ1mzZg03OmTFCt4eVgbc+YZnMNgwvRGvjc=";
};
import svgwrite
import sys
import math
from cmath import rect, phase
# Takes a strings seperated by newline from stdin, sanitizes to only contain numbers 1-12,
# generates a compass for the average value this is saved as "compass.svg".
# Example usage:
# cat text.txt | python avgcompass.py
# Example compass generated: https://i.imgur.com/2m1FaAd.png