Skip to content

Instantly share code, notes, and snippets.

View earwin's full-sized avatar

Earwin earwin

  • Portugal
View GitHub Profile
@earwin
earwin / orderedmap.go
Last active October 9, 2024 02:18
An implementation of column.IterableOrderedMap for clickhouse-go
package orderedmap
import (
"cmp"
"github.com/ClickHouse/clickhouse-go/v2/lib/column"
"slices"
)
// Map is a simple implementation of [column.IterableOrderedMap] interface.
// It is intended to be used as a serdes wrapper for map[K]V and not as a general purpose container.
@earwin
earwin / osx-env-sync
Created December 26, 2022 18:36
Sync OSX GUI app environment with command line
#!/usr/bin/env zsh
# zsh and ruby are used for convenience, but both are shipped with macos, so no big deal
DONOR_SHELL=/opt/local/bin/zsh # pick the shell you use in terminal and have your env configured in
SCRIPT=${0:A} # autodetect this script's absolute path
PLIST=~/Library/LaunchAgents/osx-env-sync.plist
write_plist() {
cat > $1 <<EOF
<?xml version="1.0" encoding="UTF-8"?>