Skip to content

Instantly share code, notes, and snippets.

blueprint:
name: Flur Licht Occupancy mit Helligkeit
description: Licht an wenn Bewegung erkannt und es dunkel ist, aus wenn keine Bewegung
domain: automation
input:
occupancy_sensor:
name: Occupancy Sensor
selector:
entity:
domain: binary_sensor
blueprint:
name: Philips Hue Dimmer RWL022 (Z2M)
description: Toggle + Dimmen mit Hue Dimmer RWL022 via Zigbee2MQTT
domain: automation
input:
remote_name:
name: Zigbee2MQTT Gerätename
description: Exakter Name des Dimmers in Zigbee2MQTT
selector:
text:
# GPU-accelerated SDF brick evaluation via type-specialized operations
#
# The SDF.Node tree is converted into nested structs where each operation is
# a concrete type parameter. Julia specializes `eval_sdf` on the full tree
# type, and KernelAbstractions compiles it to GPU code. No command buffer,
# no interpreter - just compiled arithmetic.
#
# Example:
# gpu_tree = to_gpu_op(sdf_node)
# # typeof(gpu_tree) == GPUUnion{GPUTranslation{GPUSphere}, GPURect}
@SimonDanisch
SimonDanisch / benchmark-wglmakie.jl
Last active June 23, 2025 13:55
Benchmarking Makie v0.24 against v0.23
using WGLMakie, Bonito
MSGS = Dict()
function run_example!(figfunc, name, testfunc)
f, ax, pl = figfunc()
display(f)
_testfunc() = begin
testfunc(f, ax, pl)
if isdefined(WGLMakie, :poll_all_plots)
WGLMakie.poll_all_plots(f.scene)

Always run wsl --update first. Also make sure to run Windows update + make sure all GPU drivers are up to date (google $(GPU_NAME) update treiber windows).

OpenSuse:

Install OpenSuse tumbleweed via appstore. Then:

sudo zypper refresh
sudo zypper update
ARG IMAGE=nvidia/cuda:12.1.1-devel-ubuntu22.04
FROM $IMAGE
ARG JULIA_RELEASE=1.9
ARG JULIA_VERSION=1.9.4
# julia
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive \
using Preferences
for uuid in ["ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a", "e9467ef8-e4e7-5192-8a1a-b1aee30e663a",
"276b4fcb-3e11-5398-bf8b-a0c2d153d008", "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"]
set_preferences!(Base.UUID(uuid), "precompile_workload" => false; force=true)
end
@SimonDanisch
SimonDanisch / mandelbrot.jl
Created September 9, 2023 09:54
Mojo vs Julia mandelbrot benchmark
# Super simple SIMD implementation for Complex Numbers
struct ComplexSIMD{N,T}
re::NTuple{N,T}
im::NTuple{N,T}
end
Base.abs2(z::ComplexSIMD) = z.re .* z.re .+ z.im .* z.im
Base.:(*)(a::ComplexSIMD, b::ComplexSIMD) = ComplexSIMD(a.re .* b.re .- a.im .* b.im, a.re .* b.im .+ a.im .* b.re)
Base.:(+)(a::ComplexSIMD, b::ComplexSIMD) = ComplexSIMD(a.re .+ b.re, a.im .+ b.im)
function mandelbrot_kernel(c::ComplexSIMD{N,T}) where {N,T}
using Mmap, TextParse
using TextParse: Record, Field, Numeric, tryparsenext, isnull
struct MMapString{T} <: AbstractVector{Char}
x::T
end
MMapString(path::String) = MMapString(Mmap.mmap(open(path), Vector{UInt8}))
# we only need to overload the iteration protocol for TextParse to work!
Base.Base.@propagate_inbounds Base.getindex(x::MMapString, i) = Char(x.x[i])
Base.Base.@propagate_inbounds function Base.iterate(x::MMapString, state...)
julia --project=. -e "using Pkg; pkg"add RadeonProRender#sd/moah GeometryBasics RadeonProRender_jll@2.2.7"

executed with:

julia --project=. --check-bounds=(yes|no) rpr_mwe.jl

Diff of the llvm code: https://www.diffchecker.com/chE5Jtim