Skip to content

Instantly share code, notes, and snippets.

View carolynvs's full-sized avatar

Carolyn Van Slyck carolynvs

View GitHub Profile
@carolynvs
carolynvs / publish-charts.mk
Last active March 2, 2019 12:57
Publish Helm Charts to Azure storage
build-image:
docker build -t build-image ./scripts/build-image/
charts-push: build-image
docker run --rm -it \
-v `pwd`:/go/src/github.com/carolynvs/mypkg \
-e AZURE_STORAGE_CONNECTION_STRING \
build-image ./scripts/push-charts.sh
@carolynvs
carolynvs / sketchtool-diff-steps.md
Last active March 5, 2019 13:01
Configure Diffs for Sketch Files
  1. Add the following line to your ~/.bash-profile
    export PATH=$PATH:"$(mdfind kMDItemCFBundleIdentifier == 'com.bohemiancoding.sketch3' | head -n 1)/Contents/Resources/sketchtool/bin/"
    
  2. Add the following lines to your ~/.gitconfig
    [diff "sketchtool"]
      textconv = "sketchtool dump"
      cachetextconv = true
    

binary = true

@carolynvs
carolynvs / gofind.sh
Last active July 10, 2020 14:16
Find a go project in your GOPATH, written by @steder
#!/usr/bin/env bash
# Just source this file or copy/paste this function in your ~/.bashrc or ~/.bash_profile
function gof {
if (( $# == 0 )); then
echo "usage: $gof <dir>"
echo "jumps to $GOPATH/src directory matching <dir>"
return
fi
GOPATH=${GOPATH:-~/go}
@carolynvs
carolynvs / .gitconfig
Last active October 19, 2022 14:44
git wip - Show what branches you have been working on lately
[alias]
wip = for-each-ref --sort='authordate:iso8601' --format=' %(color:green)%(authordate:relative)%09%(color:white)%(refname:short)' refs/heads
@carolynvs
carolynvs / create-user-namespace.sh
Last active January 11, 2021 14:13
Create a user and a dedicated namespace for it. Grant admin on the namespace and also to CRDs and RBAC.
#!/bin/bash
set -eo pipefail
# https://computingforgeeks.com/restrict-kubernetes-service-account-users-to-a-namespace-with-rbac/
if [[ "$1" == "" ]]; then
echo "usage: create-user-namespace.sh USERNAME"
exit 1
fi
@carolynvs
carolynvs / magefile.go
Last active January 24, 2021 01:34
example magefile
// +build mage
package main
import (
"github.com/carolynvs/magex/pkg"
"github.com/magefile/mage/mg"
"github.com/magefile/mage/sh"
)
@carolynvs
carolynvs / main.go
Created October 4, 2021 01:19
exit main and execute defered statements
func main() {
run := func() int {
p := porter.New()
defer p.Close()
cmd := buildRootCommandFrom(p)
if err := cmd.Execute(); err != nil {
return 1
}
return 0