Skip to content

Commit eb347a9

Browse files
committed
Added minio edit function
1 parent 2d3ac85 commit eb347a9

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

.zsh_secrets

+19-7
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ export SOCIALBLADE_API="(redacted)"
55
export SOCIALBLADE_EMAIL="[email protected]"
66
export SOCIALBLADE_TOKEN="(redacted)"
77
export SOCIAL_BLADE_DISCORD_TOKEN="Bot (redacted)"
8-
export SOCIALBLADE_EPOCH="1202446179000"
9-
sb_snow () {
10-
epoch=$(($1 >> 23 + $SOCIALBLADE_EPOCH))
11-
date -r $(($epoch/1000))
12-
}
138

149
# Twitch API
1510
export TWITCH_OAUTH="(redacted)"
@@ -21,8 +16,6 @@ export SPOTIFY_CLIENT_SECRET="(redacted)"
2116

2217
alias icloud="~/Library/Mobile\ Documents/com~apple~CloudDocs/"
2318

24-
alias k="k9s --readonly"
25-
2619
if [ $TERM = 'xterm-kitty' ]; then
2720
export PATH=/Applications/kitty.app/Contents/MacOS/kitty:$PATH
2821

@@ -56,6 +49,25 @@ test_https() {
5649
curl --insecure -vvI https://$1 -H "Host: $2" 2>&1 | awk 'BEGIN { cert=0 } /^\* SSL connection/ { cert=1 } /^\*/ { if (cert) print }'
5750
}
5851

52+
mc_edit() {
53+
if [ -z "$1" ]
54+
then
55+
echo "What're you going to edit, the void?";
56+
echo "mc_edit <input>"
57+
echo "mc_edit <input> <output>"
58+
else
59+
# If no second arg make the output the same as the input
60+
if [ -z "$2" ]
61+
then
62+
2=$1
63+
fi
64+
TMP=$(openssl rand -base64 8 | tr -dc '[:alnum:]\n\r')
65+
mc cat $1 > /tmp/$TMP.${1##*.}
66+
$EDITOR /tmp/$TMP.${1##*.}
67+
mc cp /tmp/$TMP.${1##*.} $2
68+
fi
69+
}
70+
5971
alias dark="~/.config/kitty/switch_theme.sh dark"
6072
alias light="~/.config/kitty/switch_theme.sh light"
6173

0 commit comments

Comments
 (0)