I hereby claim:
- I am kriansa on github.
- I am kriansa (https://keybase.io/kriansa) on keybase.
- I have a public key whose fingerprint is BC27 7BE0 9E8A 6F10 59C3 911B 3E78 8475 6312 F945
To claim this, I am signing this object:
| package log | |
| import ( | |
| "context" | |
| "log/slog" | |
| "os" | |
| "time" | |
| "github.com/charmbracelet/lipgloss" | |
| "github.com/charmbracelet/log" |
| # This is useful for loading a .env file and ensuring you don't override the | |
| # environment variables already set. | |
| # | |
| # Usage: load-env-file filename.env | |
| load-env-file() { | |
| local env_file=$1 | |
| # Save a reference of all existing variables | |
| while IFS= read -rd $'\0' var; do | |
| name="${var%%=*}" |
| export default function ({ $axios }) { | |
| // Because API is always considered as a cross-domain call, the default | |
| // XSRF feature available on axios will not work for us, because they use | |
| // cookies and cookies aren't readable in cross-domains. Instead we must | |
| // rely on having CSRF sent on every header request by the backend, and | |
| // then we store that value to send on the next subsequent request. | |
| // | |
| // See: https://github.com/axios/axios#interceptors | |
| $axios.interceptors.request.use((config) => { | |
| if (!config.method.includes('get', 'head', 'options')) { |
| // Here after the $auth is properly initialized, we add the idToken as part of the Authorization | |
| // header sent to our API, as it is authenticatable by using the IDToken (JWT), not the AuthToken. | |
| $axios.interceptors.request.use((config) => { | |
| config.headers['Authorization'] = `Bearer ${$auth.strategy.idToken.get()}` | |
| return config | |
| }) | |
| // By default, axios request interceptors are executed in the order they are added in the | |
| // interceptors stack. At this point on runtime, Nuxt Auth has already injected an interceptor | |
| // that adds an Authorization token to the requests, so we are unable to override it unless we |
| #!/usr/bin/env bash | |
| # | |
| # Automatically updates the IP addresses for the ingress rules for SSH access | |
| # at my home proxy instance on Vultr | |
| # | |
| # Requires: jq, curl, dig | |
| config() { | |
| # Define your Vultr API Key | |
| export VULTR_API_KEY=YOUR-VULTR-API-KEY |
| # This will generate a monospaced progress bar with a progress percentage displayed in the center of it | |
| # Usage: progress-bar <percentage> <width> | |
| # Example output: "———————— 80% —————— " | |
| progress-bar() { | |
| local percentage=$1 | |
| local width=$2 | |
| local fill_bars; fill_bars=$(( width * percentage / 100 )) | |
| local fill_spaces; fill_spaces=$(( width - fill_bars )) | |
| local bar="" |
| #!/usr/bin/env bash | |
| # | |
| # Automatically updates the IP addresses for the ingress rules for SSH access on Vultr | |
| # | |
| # Requires: jq, curl, dig | |
| main() { | |
| export VULTR_API_KEY="YOUR-VULTR-API-KEY" | |
| # Get existing rules at the Vultr firewall |
| #!/usr/bin/env bash | |
| help() { | |
| echo "Makes hardlinks out of a list of duplicates files generated by rdfind." | |
| echo | |
| echo "usage: $0 <duplicates_file>" | |
| } | |
| main() { | |
| local duplicates_file=$1 |
| # Append this content to the file /usr/share/X11/xkb/rules/evdev | |
| # | |
| # Custom options patch by Kriansa | |
| ! option = symbols | |
| custom:multimedia_fn_keys = +media(multimedia_fn_keys) | |
| custom:scroll_lock_key_usable = +media(scroll_lock_key_usable) |
I hereby claim:
To claim this, I am signing this object: