ssh-keygen -t ed25519 -C [email protected]
# save to ~/.ssh/id_new_ssh_keys
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
tsplay () { | |
local app="$1" | |
local workspace="${2:-default}" | |
local default_root="$HOME/tsplay" | |
local work_root="${TSPLAY_ROOT:-$default_root}" | |
local workspace_dir="$work_root/$workspace" | |
local lsws="$(ls -1 "$work_root"|sort|sed 's/^/ /')" | |
local usage="Usage: tsplay -a <app> [-w <workspace>]\n" | |
usage+="Existing workspaces:\n" | |
usage+="$lsws" |
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 ( | |
"fmt" | |
"math" | |
"os" | |
"strconv" | |
"time" | |
) |
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
#!/usr/bin/env bash | |
# default root directory for goplay | |
GOPLAY_ROOT=""$HOME/goplay"" | |
# fn:goplay:create a go playground | |
function goplay() { | |
local module_name="${1:-anon}" | |
local ts="$(date +%Y-%m-%d_%H%M%S)" | |
local dirname="$GOPLAY_ROOT/$module_name-$ts" | |
local go_version=$(go version | awk '{print $3}' | sed -e 's/go//' | awk -F. '{print $1"."$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
package main | |
import ( | |
"fmt" | |
"log" | |
"net" | |
"os" | |
"regexp" | |
"strconv" | |
"time" |
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
#!/usr/bin/env bash | |
BUILD_TIME="$(date --iso-8601=seconds)" | |
COMMIT_SHA="$(git rev-parse HEAD 2>/dev/null && true)" | |
# or | |
# git rev-parse --short=8 HEAD 2>/dev/null && true | |
COMMIT_SHORT_SHA="${COMMIT_SHA:0:8}" | |
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD && true) |
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
var nativeEndian binary.ByteOrder | |
func setByteOrder() { | |
buf := [2]byte{} | |
*(*uint16)(unsafe.Pointer(&buf[0])) = uint16(0xABCD) | |
switch buf { | |
case [2]byte{0xCD, 0xAB}: | |
nativeEndian = binary.LittleEndian |
[ngStyle]={fontSize: '1em'}
[style.fontSize.em]=2
[style]={fontSize: '3em'}
style="font-size: 4em"
@Directive({host: {'[style.fontSize.em]': 5}})
@Directive({host: {'style': 'fontSize: 6em;'}})
Keploy is a no-code API testing platform that generates tests-cases and data-mocks from API calls. Dependency-mocks are automatically generated with the recorded request/responses.
- works with go for sure
- python is WIP
- https://github.com/keploy/keploy
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
#!/usr/bin/env bash | |
login_path="$1" | |
database_name="$2" | |
dir="$HOME/.mysql_backups" | |
/usr/local/bin/mysqldump --login-path="$login_path" "$database_name" | gzip > "$dir/$database_name-$(/bin/date +%Y-%m-%d_%H%M%S).sql.gz" |
NewerOlder