Skip to content

Instantly share code, notes, and snippets.

View jkrumbiegel's full-sized avatar

Julius Krumbiegel jkrumbiegel

View GitHub Profile
@jkrumbiegel
jkrumbiegel / new_packages_over_time.jl
Created June 24, 2026 10:44
Count new Julia package registrations per month from the General registry and plot the trend (RegistryActivity + AlgebraOfGraphics/CairoMakie)
using Pkg
Pkg.activate(; temp = true)
Pkg.add(["DataFrames", "CairoMakie", "AlgebraOfGraphics"])
Pkg.add(url = "https://github.com/JuliaEcosystem/RegistryActivity.jl")
using RegistryActivity, DataFrames, Dates, CairoMakie, AlgebraOfGraphics
const AoG = AlgebraOfGraphics
# RegistryActivity.clone_registry() clones via LibGit2, which fails on macOS with a
# SecureTransport error; clone with the system git and pass the path instead.
@jkrumbiegel
jkrumbiegel / ann_over_time.jl
Last active June 24, 2026 10:33
Count Julia Discourse [ANN] posts over time and plot the trend (AlgebraOfGraphics/CairoMakie)
using Pkg
Pkg.activate(; temp = true)
Pkg.add(["HTTP", "JSON3", "DataFrames", "CairoMakie", "AlgebraOfGraphics"])
using HTTP, JSON3, DataFrames, Dates, CairoMakie, AlgebraOfGraphics
const AoG = AlgebraOfGraphics
const SEARCH_URL = "https://discourse.julialang.org/search.json"
function search_page(query, page)
@jkrumbiegel
jkrumbiegel / fontOnCurve.jl
Created April 12, 2026 11:25
TextOnPath for Makie 0.24 — place text along a BezierPath
using LinearAlgebra: norm
"""
TextOnPath(text::String, path::Makie.BezierPath)
A text value that lays out characters along a `BezierPath`. Pass as the `text`
argument to `text!`, together with `markerspace = :data` so that glyph positions
and fontsize are in data-space units. The text position should be `Point2f(0)`.
Important: don't provide a closed path — it can lead to infinite loops.
@jkrumbiegel
jkrumbiegel / makie_table_widget.jl
Created January 28, 2026 12:43
Makie Table widget
using GLMakie
##
@recipe TextTable (origin,) begin
text = String[;;] # size = (rows, columns)
cell_padding = Vec4f(5, 5, 2, 2)
colsize = Makie.automatic # could be a vector
rowsize = Makie.automatic # could be a vector
@jkrumbiegel
jkrumbiegel / image_extending_out_of_axis.jl
Created January 16, 2026 21:38
Image extending out of Makie Axis
using CairoMakie
img = Makie.loadasset("cow.png")
sz = reverse(size(img))
f = Figure()
for i in 1:3, j in 1:3
Axis(f[i, j])
end
ax = content(f[2, 2])
@jkrumbiegel
jkrumbiegel / tangent_lines_circles_makie.jl
Created September 1, 2025 07:19
Tangent lines two circles Makie projected
using LinearAlgebra
"""
outertangents(c1::Circle, c2::Circle) -> Vector{Tuple{Point2f, Point2f}}
Compute the outer tangent lines between two circles.
Returns a vector of two tuples, each containing two Point2f objects representing the endpoints of the outer tangent lines.
"""
function outertangents(c1, c2)
# Extract centers and radii
@jkrumbiegel
jkrumbiegel / makie_tab_interface.jl
Created July 25, 2025 17:51
Makie tab interface using deletion
function tear_down!(tabgrid)
for e in @view tabgrid.content[end:-1:begin]
if e.content isa GridLayout
tear_down!(e.content)
Makie.GridLayoutBase.remove_from_gridlayout!(e)
else
delete!(e.content)
end
end
trim!(tabgrid)
@jkrumbiegel
jkrumbiegel / bar.jl
Created July 18, 2025 09:31
dodged bar smaller bar inside AlgebraOfGraphics
mapping(
["X", "X", "X"],
[1, 2, 3],
dodge = ["A", "B", "C"],
color = ["A", "B", "C"],
) * visual(BarPlot, direction = :x) +
mapping(
["X", "X", "X"],
[0.7, 1.5, 2.2],
dodge = ["A", "B", "C"],
@jkrumbiegel
jkrumbiegel / gist:52a90ff54149617ff7eb2431433d9e80
Created July 18, 2025 09:30
dodged bar scatter markers AoG
mapping(
["X", "X", "X"],
[1, 2, 3],
dodge = ["A", "B", "C"],
color = ["A", "B", "C"],
) * visual(BarPlot, direction = :x) +
mapping(
[0.7, 1.8, 2.2],
["X", "X", "X"],
dodge_y = ["A", "B", "C"]
@jkrumbiegel
jkrumbiegel / pretalx_pdf_schedule.jl
Last active January 19, 2026 13:40
juliacon pretalx custom pdf schedule
using JSON
using Downloads
using Typst_jll
using Dates
url = "https://pretalx.com/juliacon-2025/schedule/export/schedule.json"
json = JSON.parsefile(Downloads.download(url))