Skip to content

Instantly share code, notes, and snippets.

View mg98's full-sized avatar
🪄

Marcel Gregoriadis mg98

🪄
View GitHub Profile
@mg98
mg98 / psi-poc.ipynb
Created September 11, 2023 17:35
Proof-of-Concept: Private Set Intersection
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mg98
mg98 / post-merge
Last active September 26, 2022 11:17
Detect newly added vars in .env.example and automatically merge them into .env
#!/bin/bash
addedVars=$(git diff ORIG_HEAD HEAD --exit-code -- .env.example | tail -n +6 | grep '^\+' | sed '/^\+/ s/^\+//' | sed '/^[[:space:]]*$/d')
new=$(echo "$addedVars" | while read v; do
if [[ !$(cat .env | grep ^$v=) ]]; then
echo $v
fi
done)
if [[ "$new" ]]; then
@mg98
mg98 / set.go
Last active January 27, 2023 16:54
Implementation of a generic Set type in Go (1.18+)
// Set is a collection of unique values.
type Set[T comparable] struct {
elements map[T]bool
}
// NewSet creates a new empty set.
func NewSet[T comparable]() *Set[T] {
return &Set[T]{elements: map[T]bool{}}
}