From 03efc4915812107dbda4787e54fc289d426f8a0f Mon Sep 17 00:00:00 2001 From: pika Date: Mon, 17 Mar 2025 11:37:27 +0100 Subject: [PATCH] removed: zshdef --- .zshdef | 62 --------------------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 .zshdef diff --git a/.zshdef b/.zshdef deleted file mode 100644 index e4caf10..0000000 --- a/.zshdef +++ /dev/null @@ -1,62 +0,0 @@ -# ─< Helper functions >───────────────────────────────────────────────────────────────── -# ANSI color codes -RED='\033[0;31m' -CYAN='\033[0;36m' -YELLOW='\033[0;33m' -LIGHT_GREEN='\033[0;92m' -BOLD='\033[1m' -NC='\033[0m' # No Color - -# Logging functions with emojis -echo_error() { - local msg="${RED}❌ $1${NC}\n" - # printf "$msg" >&2 - _MESSAGES[error]+="$msg" -} - -echo_warning() { - local msg="${YELLOW}⚠️ $1${NC}\n" - # printf "$msg" - _MESSAGES[warn]+="$msg" -} - -echo_info() { - local msg="${CYAN}ℹ️ $1${NC}\n" - # printf "$msg" - _MESSAGES[info]+="$msg" -} - -# ─< proxy config >─────────────────────────────────────────────────────────────────────── -proxy() { - case "$1" in - --show) - echo {"http: $http_proxy, $HTTP_PROXY" - "https: $https_proxy, $HTTPS_PROXY"} - ;; - *) - echo "You entered something wrong!" - ;; - esac - - local ip="172.22.11.69" - local port="8080" - - # Check if the IP and port are reachable - if nc -z -w5 $ip $port; then - # If reachable, set the proxy environment variables - export http_proxy="http://$ip:$port" - export https_proxy="http://$ip:$port" - export HTTP_PROXY="http://$ip:$port" - export HTTPS_PROXY="http://$ip:$port" - echo_info "Proxy set to: http://$ip:$port" || echo "Proxy set to: http://$ip:$port" - else - echo_error "IP $ip with port $port is not reachable." || echo "IP $ip with port $port is not reachable." - fi - - alias proxy='echo "http: $HTTP_PROXY"; echo "https: $HTTPS_PROXY"' -} - -# ─< unset proxy >──────────────────────────────────────────────────────────────────────── -noproxy() { - unset {HTTP_PROXY,HTTPS_PROXY,http_proxy,https_proxy} -}