Skip to content

Instantly share code, notes, and snippets.

View mahelbir's full-sized avatar

Mahmuthan Elbir mahelbir

View GitHub Profile
@mahelbir
mahelbir / cfd.sh
Created September 28, 2026 19:25
Cloudflare Quick Tunnels
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
@mahelbir
mahelbir / kkm.js
Created August 21, 2022 21:13
Kur Korumalı Vadeli Mevduat Faizi Hesaplama
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;
}
}