Skip to content

Instantly share code, notes, and snippets.

View full-sized avatar
🦖
Using modern software.

Frank Meeusen versionsix

🦖
Using modern software.
  • Belgium, Antwerp
View GitHub Profile
@versionsix
versionsix / main.go
Created June 23, 2022 12:52
go serverside events curl
View main.go
package main
import (
"log"
"net/http"
"strconv"
"time"
"gopkg.in/antage/eventsource.v1"
)
@versionsix
versionsix / _assert.md
Created May 11, 2022 11:24
[DOC] stretchr/testify/assert
View _assert.md

assert

import "github.com/stretchr/testify/assert"

Package assert provides a set of comprehensive testing tools for use with the normal Go testing system.

@versionsix
versionsix / main.go
Created May 3, 2022 05:47
Golang parse json with invalid "string-int" types
View main.go
package main
import (
"encoding/json"
"fmt"
"reflect"
"strconv"
)
type invalidStrNums []int
@versionsix
versionsix / Makefile
Created January 27, 2022 04:23
pcie naming root devices and such, dump
View Makefile
# Just completions
# just --completions zsh | sudo tee /usr/local/share/zsh/site-functions/_just
# zinit creinstall -q /usr/local/share/zsh/site-functions/
export http_proxy := "http://172.31.100.7:3128/"
# https://uk.lxd.images.canonical.com/images/
# https://cloud-images.ubuntu.com/impish/current/
# 537M Ubuntu Server Cloud Image Builds
@versionsix
versionsix / README.md
Created November 19, 2021 19:58 — forked from zerok/README.md
OmniGraffle: Export layers on top of base-layer as PNG
View README.md

Layer export for OmniGraffle

If you have a Graffle document (doc.graffle) with a canvas named "mycanvas" holding the following layers ...

  • Extra 3
  • Extra 2
  • Extra 1
  • Base

... then these images will be generated:

@versionsix
versionsix / gcp-iam-restrict-user-bucket.sh
Created November 13, 2021 14:04 — forked from pydevops/gcp-iam-restrict-user-bucket.sh
Google Cloud Platform example to add IAM role restricting user to specific storage buckets with conditions
View gcp-iam-restrict-user-bucket.sh
#!/usr/bin/env bash
export PROJECT_ID=$(gcloud config get-value project)
export PROJECT_USER=$(gcloud config get-value core/account) # set current user
export PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID --format="value(projectNumber)")
export IDNS=${PROJECT_ID}.svc.id.goog # workload identity domain
export GCP_REGION="us-central1"
export GCP_ZONE="us-central1-a"
@versionsix
versionsix / vpn
Created October 4, 2021 08:36 — forked from alyssais/vpn
A tiny command line interface to Viscosity
View vpn
#!/usr/bin/env bash
run_list() {
osascript <<OSA
tell application "Viscosity"
repeat with theConnection in connections
set theName to name of theConnection
set theState to state of theConnection
log theName & ": " & theState
end repeat
@versionsix
versionsix / bluetooth_sleep.lua
Created September 23, 2021 14:11 — forked from ysimonson/bluetooth_sleep.lua
Hammerspoon script to disable bluetooth when the computer is put to sleep. Requires `blueutil` to be installed (`brew install blueutil`).
View bluetooth_sleep.lua
require "string"
function checkBluetoothResult(rc, stderr, stderr)
if rc ~= 0 then
print(string.format("Unexpected result executing `blueutil`: rc=%d stderr=%s stdout=%s", rc, stderr, stdout))
end
end
function bluetooth(power)
print("Setting bluetooth to " .. power)