This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"fmt" | |
"net/http" | |
"net/url" | |
) | |
type TestClient struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"net/url" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// #cgo LDFLAGS: -framework CoreGraphics | |
// #include <CoreGraphics/CoreGraphics.h> | |
import "C" | |
import ( | |
"fmt" | |
"math" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DDH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"net/http" | |
"os" | |
"regexp" | |
"sort" | |
"strconv" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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