Skip to content

Instantly share code, notes, and snippets.

@Villenny
Villenny / refreshenv.bashrc
Last active June 25, 2023 00:02
Chocolatey refreshenv for GIT Bash.
function refreshenv
{
powershell -NonInteractive - <<EOF
\$filename="C:\temp\refresh.env"
Write-Host("Updating environment session from chocolatey")
Import-Module "\$env:ChocolateyInstall\\helpers\\chocolateyProfile.psm1"
Update-SessionEnvironment
Write-Host("Scanning env")
# Round brackets in variable names cause problems with bash
@Villenny
Villenny / handlerChain.go
Created August 13, 2020 19:26
Build a chain of http.HandlerFuncs in go
package httpServer
import (
"net/http"
)
/*
GIVEN MIDDLEWARES TO WIRE IN COMPONENTS LIKE:
func RequestIDMiddleware(makeTimeBasedUUIDFn func() string, next http.HandlerFunc) http.HandlerFunc {
fn := func(w http.ResponseWriter, r *http.Request) {