This file contains hidden or 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
| cfd() { | |
| local port=$1 | |
| cloudflared tunnel --url "http://localhost:$port" 2>&1 | while IFS= read -r line; do | |
| echo "$line" | |
| if echo "$line" | grep -qE 'https://[a-zA-Z0-9.-]+\.trycloudflare\.com'; then | |
| local url=$(echo "$line" | grep -oE 'https://[a-zA-Z0-9.-]+\.trycloudflare\.com') | |
| if command -v pbcopy &>/dev/null; then | |
| echo -n "$url" | pbcopy | |
| elif command -v xclip &>/dev/null; then | |
| echo -n "$url" | xclip -selection clipboard |
This file contains hidden or 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 kkm(charge, startRate, endRate, days=92, percentage=17){ | |
| let interest = charge * (percentage / 100) * (days / 365); | |
| let forex = (endRate - startRate) * (charge / startRate); | |
| if(forex > interest){ | |
| return forex + charge; | |
| } else { | |
| return interest + charge; | |
| } | |
| } |