Skip to content

Instantly share code, notes, and snippets.

View bernhard-42's full-sized avatar

Bernhard bernhard-42

  • Munich, Germany
View GitHub Profile
@bernhard-42
bernhard-42 / poc.py
Created October 17, 2022 19:13
build123d separation of concerns
import cadquery as cq
from build123d import *
from typing import Union
from build123d.build_common import LocationList
VectorLike = Union[Vector, tuple[float, float], tuple[float, float, float]]
RotationLike = Union[tuple[float, float, float], Rotation]
class SolidType:
@bernhard-42
bernhard-42 / vector.py
Last active October 15, 2022 09:13
A PEP8 facade for CadQuery Vector class
import math
from typing import Union, Sequence, overload
import cadquery as cq
from OCP.gp import gp, gp_Vec, gp_Pnt, gp_Dir, gp_XYZ
class Vector:
"""Create a 3-dimensional vector
@bernhard-42
bernhard-42 / patch-brave-on-macos.sh
Last active January 9, 2021 12:24
Patch ntp and toolbar colors of Brave Browser
#!/bin/bash
set -x
BRAVE_FW="/Applications/Brave Browser.app/Contents/Frameworks/Brave Browser Framework.framework"
PAK="$BRAVE_FW/Versions/Current/Resources/brave_resources.pak"
ls -l "$PAK"
if [[ $1 == "-r" ]]; then
if [[ -f /tmp/brave_resources.pak ]]; then
echo "Restoring latest resource file"
cp /tmp/brave_resources.pak "$PAK"