Skip to content

Instantly share code, notes, and snippets.

@nicksherron
nicksherron / keycloak_postman_token.js
Last active January 7, 2022 02:06
pre request script to update postman with new keycloak token if its expired
// refresh token if it's expired
var client_id = pm.collectionVariables.get("client_id")
var client_secret = pm.collectionVariables.get("client_secret")
const postRequest = {
url: pm.collectionVariables.get("sandbox_auth_url") + "protocol/openid-connect/token",
method: 'POST',
header: 'Content-Type:application/x-www-form-urlencoded',
body:{
#!/usr/bin/env zsh
alias f='fd -t f -IH --exclude=.git'
sd astur_kitchensink_srv astur_kitchensink $(f)
sd astur_kitchensink_svc astur_kitchensink $(f)
sd inventory-mgmt-image kitchensink-image $(f)
sd inventory-mgmt-srv kitchensink $(f)
sd inventory-mgmt-svc kitchensink $(f)
sd inventory_mgmt_svc kitchensink $(f)
*fugitive.txt* A Git wrapper so awesome, it should be illegal
Author: Tim Pope <http://tpo.pe/>
License: Same terms as Vim itself (see |license|)
This plugin is only available if 'compatible' is not set.
INTRODUCTION *fugitive*
Whenever you edit a file from a Git repository, a set of commands is defined
#!/usr/bin/env bash
#
# Prepare the commit message by adding a release note.
require_justification=0
set -euo pipefail
if [[ "${2-}" = "message" ]]; then
# This git command is non-interactive so it will not filter out any comments
# we add. There is nothing more for us to do.
@nicksherron
nicksherron / labels.sh
Last active October 2, 2021 06:07
Git blame of all label usage in go std library using ripgrep, awk and git.
#!/usr/bin/env sh
tmp=$(mktemp -d -t `date +%s`)
cd $tmp
git clone https://github.com/golang/go
cd go
files=$(rg -n -s '^\S+:\n' --type=go --glob='!*test*' --glob='!*internal*' --glob='!*vendor*' --glob='!*doc.go')
for i in `echo $files`; do
echo $i | awk 'BEGIN { FS=":"} /1/ {print $1 " -L " $2","$2} ' | xargs git --no-pager blame ;
done
#!/usr/bin/env zsh
echo "installing tbls"
brew install k1LoW/tap/tbls
echo "brew install mysql"
brew install mysql
brew services start mysql
$(brew --prefix mysql)/bin/mysqladmin -u root password p@ssw0rd
brew services stop mysql
{
"__inputs": [
{
"name": "DS_LOKI",
"label": "Loki",
"description": "",
"type": "datasource",
"pluginId": "loki",
"pluginName": "Loki"
},
package redis_test
import (
"context"
"fmt"
"os"
"strings"
"testing"
"time"
package inventory_svc
import (
"encoding/json"
"errors"
"fmt"
"net/http"
"strconv"
"time"
# cat << EOF > /dev/null
# https://github.com/gpakosz/.tmux
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
# without any warranty.
# Copyright 2012— Gregory Pakosz (@gpakosz).
# /!\ do not edit this file
# instead, override settings in ~/.tmux.conf.local, see README.md
# -- general -------------------------------------------------------------------