Skip to content

Instantly share code, notes, and snippets.

// "forked" from here, but fork button wasn't working, so copy/pated...
// https://gist.github.com/walm/e61b5e44b37a67c6eaa1e7c048ef7bf1
package main
import (
"bytes"
"encoding/json"
"fmt"
"regexp"
"time"
@cokert
cokert / OpenBranchInGithub.sh
Last active December 12, 2019 19:25
This is a shell script to open the current folder and branch in GitHub
#! /usr/bin/env zsh
if git rev-parse --git-dir > /dev/null 2>&1; then
: # This is a valid git repository (but the current working
# directory may not be the top level.
# Check the output of the git rev-parse command if you care)
REMOTE=`git remote -v`
BRANCH=`git status`
CURPATH=`git rev-parse --show-toplevel`
DIR=`pwd`
@cokert
cokert / GenerateGoDocs.sh
Last active January 17, 2020 22:34
Generate GO documentation
#note this depends on having the script at the gist below available by calling relapth.sh
#https://gist.github.com/cokert/089100625c6ebed2d10650b223cb7ca4
if [ -z $1 ]
then
echo "destination not supplied"
exit 1
fi
SRC=${PWD}
@cokert
cokert / relpath.sh
Created January 16, 2020 20:47
Relative Paths
# https://stackoverflow.com/a/12498485/88066
# both $1 and $2 are absolute paths beginning with /
# returns relative path to $2/$target from $1/$source
source=$1
target=$2
common_part=$source # for now
result="" # for now
@cokert
cokert / TimTom.karabiner
Last active October 25, 2021 15:53
Custom Karibiner mods
{
"title": "TimTom's Mods",
"rules": [
{
"description": "Cmd+D == Cmd+L in Chrome Firefox and Safari",
"manipulators": [
{
"type": "basic",
"from": {
"modifiers": {
@cokert
cokert / .update-ip-parameters
Last active January 15, 2024 04:06
Update DNSimple subdomain with current public facing IP as returned by ifconfig.me along with a systemd service and timer file
TOKEN=<DNSIMPLE-TOKEN>
ACCOUNT=<ACCOUNTID>
ZONE=<ZONEID-OR-DOMAINNAME>
RECORD=<RECORDID>