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
import ( | |
"encoding/base64" | |
"strings" | |
) | |
func decodeJWT(jwt string) ([]byte, error) { | |
// Split the JWT into its three parts | |
parts := strings.Split(jwt, ".") | |
if len(parts) != 3 { | |
return nil, errors.New("invalid JWT format") |
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
project | |
├ web/ | |
│ ├ build/ | |
│ ├ public/ | |
│ ├ src/ | |
│ ├ package.json | |
│ └ yarn.lock | |
├ Dockerfile | |
├ main.go | |
├ go.mod |
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
FROM node:16-alpine3.11 as build-node | |
RUN apk --no-cache --virtual build-dependencies add \ | |
python \ | |
make \ | |
g++ | |
WORKDIR /workdir | |
COPY web/ . | |
RUN yarn install | |
RUN yarn build |
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
function cd () { | |
local DOTENV="\033[1;38;5;220m[\033[0;38;5;214md\033[0;38;5;215mo\033[0;38;5;216mt\033[0;38;5;217me\033[0;38;5;218mn\033[0;38;5;219mv\033[1;38;5;220m]\033[0m" | |
if [[ -f .env ]]; then | |
echo "${DOTENV} Unscoping \033[38;5;243m.env\033[0m configuration" | |
unset $(cat .env | cut -d'=' -f1) | |
fi | |
builtin cd "$@" | |
if [[ -f .env ]]; then | |
set -o allexport | |
echo "${DOTENV} Sourcing environment from \033[38;5;243m.env\033[0m" |
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 CoreFoundation -framework SystemConfiguration -framework IOKit | |
// #include <CoreFoundation/CoreFoundation.h> | |
// #import <SystemConfiguration/SystemConfiguration.h> | |
// #import <arpa/inet.h> | |
// #include <IOKit/IOKitLib.h> | |
// | |
// CFArrayRef | |
// createInterface() |
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
for f in $HOME/.private/*.sh; do | |
source $f; | |
done |
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
$ addsecret MYLITTLEPONY unicorn8 | |
$ set_mylittlepony_token | |
$ [ ! -z $HAS_MYLITTLEPONY_TOKEN ] && echo "🦄" |
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
# addsecret - Helps manage secrets stored in a users environment within | |
# $HOME/.private. This function takes two arguments, `service` and `secret`. | |
# | |
# To debug, run with DEBUG=true addsecret [options] | |
# | |
# Usage: | |
# $ addsecret oauth_service f07s84d9a219acc8f69a8af9bd | |
# To access secret, run: set_oauth_secret | |
# -> creates $HOME/.private/oauth_service.sh | |
# -> source's $HOME/.private/oauth_service.sh |
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
# addsecret - Helps manage secrets stored in a users environment within | |
# $HOME/.private. This function takes two arguments, `service` and `secret`. | |
# | |
# To debug, run with DEBUG=true addsecret [options] | |
# | |
# Usage: | |
# $ addsecret oauth_service f07s84d9a219acc8f69a8af9bd | |
# To access secret, run: set_oauth_secret | |
# -> creates $HOME/.private/oauth_service.sh | |
# -> source's $HOME/.private/oauth_service.sh |
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
<?php | |
/************************************ | |
* | |
* arguments: | |
* $method is the requested method of the cURL, | |
* default GET | |
* $route is the URL to access | |
* default is blank | |
* $body is the body of the request for POST/PATCH/PUT, etc | |
* default is NULL |
NewerOlder