View client.go
package main | |
import ( | |
"bytes" | |
"fmt" | |
"net/http" | |
"net/url" | |
) | |
type TestClient struct { |
View hotkey.go
package main | |
// #cgo LDFLAGS: -framework Carbon | |
// #include <Carbon/Carbon.h> | |
// extern void Callback(); | |
// void RunApplicationEventLoop(); | |
// static inline OSStatus handler(EventHandlerCallRef nextHandler, EventRef theEvent, void* userData) | |
// { | |
// Callback(); | |
// return 1; |
View fortnite-status-discord.go
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"net/url" |
View k8s_manual_cron
#!/bin/bash | |
# k8s_manual_cron - Run a configured cronjob now | |
set -euo pipefail | |
IFS=$'\n\t' | |
# shellcheck disable=SC2155 | |
main() { | |
readonly cronjob_name="$1" | |
local cronjob="$(kubectl get cronjob "$cronjob_name" -o json)" | |
local jobTemplate="$(printf "%s" "$cronjob" | jq -c .spec.jobTemplate.spec)" |
View hotkey_darwin.go
package main | |
// #cgo LDFLAGS: -framework Carbon | |
// #include <Carbon/Carbon.h> | |
// extern void Callback(); | |
// void RunApplicationEventLoop(); | |
// static inline OSStatus handler(EventHandlerCallRef nextHandler, EventRef theEvent, void* userData) | |
// { | |
// Callback(); | |
// return 1; |
View idle_darwin.go
package main | |
// #cgo LDFLAGS: -framework CoreGraphics | |
// #include <CoreGraphics/CoreGraphics.h> | |
import "C" | |
import ( | |
"fmt" | |
"math" | |
) |
View kns.bash
#!/bin/bash | |
# kns lets you select a kubernetes namespace in seconds. Autocomplete, | |
# type-ahead, everything! (tested in bash and zsh) | |
kns() { | |
local current | |
local namespace | |
local selected | |
if [[ ! -x "$(which fzf 2>/dev/null)" ]]; then | |
echo "please install: github.com/junegunn/fzf" >&2 |
View DDH
DDH |
View watch-pr.go
package main | |
import ( | |
"context" | |
"fmt" | |
"net/http" | |
"os" | |
"regexp" | |
"sort" | |
"strconv" |
View branch.sh
# branch will let you quickly create a git branch prefixed with your username | |
function branch() { | |
name=${@:?"mssing argument usage: branch BRANCH NAME"} | |
slug=$(echo "${name}" | tr -s "A-Z_ " "a-z--" | tr -cd "a-z0-9-" ) | |
cmd="git checkout -b ${USER}/${slug}" | |
echo -n "\033[37;1m${cmd}?\033[0m [\033[0;32menter\033[0m/\033[0;31mctrl+c\033[0m] " | |
read || return | |
eval $cmd | |
} |
NewerOlder