Skip to content

Instantly share code, notes, and snippets.

View brambg's full-sized avatar

Bram Buitendijk brambg

View GitHub Profile
@brambg
brambg / gist:91d56489264cf7712c39285bfda10651
Created August 26, 2025 12:30
hickman-ultimate-reading-order.txt
Ultimate Invasion #1-4
Ultimate Universe #1
Ultimate Spider-Man #1
Ultimate Spider-Man #2
Ultimate Black Panther #1
data class Item(val name: String, val cost: Int)
fun bestSubsets(items: List<Item>, budget: Int, topN: Int = 5): List<List<Item>> {
val allSubsets = mutableListOf<List<Item>>()
// Generate all subsets
fun generateSubsets(current: List<Item>, remaining: List<Item>) {
if (remaining.isEmpty()) {
allSubsets.add(current)
} else {
@brambg
brambg / k-rsync.sh
Created April 16, 2025 14:17
k-rsync
#!/bin/bash
# source: https://serverfault.com/questions/741670/rsync-files-to-a-kubernetes-pod
if [ -z "$KRSYNC_STARTED" ]; then
export KRSYNC_STARTED=true
exec rsync --blocking-io --rsh "$0" $@
fi
# Running as --rsh
namespace=''
@brambg
brambg / jql
Created February 5, 2025 14:15
jql: jq | less
#!/usr/bin/env bash
jq -C $* | less -R
dependencies{
implementation("org.apache.logging.log4j:log4j-api-kotlin:1.4.0")
implementation("org.apache.logging.log4j:log4j-core:2.23.1")
}
[{"@context": "http://www.w3.org/ns/anno.jsonld", "id": "urn:globalise:annotation:NL-HaNA_1.04.02_3604_0270-0276:25706", "type": "Annotation", "generated": "2024-06-26T15:31:28.066821", "body": [{"type": "SpecificResource", "purpose": "classifying", "source": {"id": "https://digitaalerfgoed.poolparty.biz/globalise/annotation/ner/LOC_NAME", "label": "Name of Location"}}], "target": [{"type": "SpecificResource", "source": "https://globalise.tt.di.huc.knaw.nl/textrepo/rest/versions/9a3858c4-4ab9-468f-aefa-75db7cc0bb84/contents", "selector": [{"type": "TextQuoteSelector", "exact": "Batavia", "suffix": " Aan zijn"}, {"type": "TextPositionSelector", "start": 1, "end": 8}]}, {"type": "SpecificResource", "source": {"@context": "http://iiif.io/api/presentation/3/context.json", "id": "https://data.globalise.huygens.knaw.nl/manifests/inventories/3604.json/canvas/p270", "type": "Canvas", "partOf": {"id": "https://data.globalise.huygens.knaw.nl/manifests/inventories/3604.json", "type": "Manifest"}}, "selector": {"type":
@prefix as: <http://www.w3.org/ns/activitystreams#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix glob: <https://github.com/globalise-huygens/nlp-event-detection/wiki#> .
@prefix ip3: <http://iiif.io/api/presentation/3#> .
@prefix oa: <http://www.w3.org/ns/oa#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sem: <http://semanticweb.cs.vu.nl/2009/11/sem/> .
@brambg
brambg / globalise-event-as-web-annotations.md
Last active March 13, 2024 23:05
globalise: event modeling as web annotations

Event as a group of annotations linked by body.id

These Web Annotations:

{
    "@context": [
        "http://www.w3.org/ns/anno.jsonld",
        "https://knaw-huc.github.io/ns/globalise.jsonld"
    ],
    "id": "urn:globalise:annotation:b85415db-cc5e-422a-a325-68ad6055b041",
@brambg
brambg / k-align
Created October 18, 2023 12:07
make kubectl apply/delete output more readable
#!/usr/bin/env bash
awk -F'[/ ]' '{
type = $1
name = $2
status = $3
# Set default text color
text_color = "\033[0m"
# Check status value and set text color accordingly
@brambg
brambg / julia.md
Last active January 24, 2019 13:41
Julia notes

Developing modules:

  • Directory structure:
Module.jl/
+--src/
|  +--Module.jl
+--test/
   +--test.jl