Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/lowmess/dotfiles.
dot-files
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546# shorter vs codec() { if [[ $# -eq 0 ]]; then command code "$(pwd)" else command code $@ fi}# Get gzip size of filegzip-size() { local bytesize=$(gzip -c $1 | wc -c) local kbsize=$(bc -l <<< "($bytesize/1024)") local formatted=$(printf "%.2f\n" $kbsize) echo "$formatted"kb}# Create a new directory and enter itmk() { mkdir -p "$@" && cd "$@"}# get current weather# can pass a city name, airport code, etc. to specify location# (see wttr.in/:help for location possibilities)# -f flag can be set to get a 3 day forecast# usage:# weather# weather phx# weather -f Londonweather() { zparseopts -D -a opts -- f local argstr="$@" local location=${argstr// /+} local request="wttr.in/${location}?Fq" if (( ${opts[(Ie)-f]} )); then [ "$COLUMNS" -lt 125 ] && request+='n' else request+='0' fi curl -H "Accept-Language: ${LANG%_*}" --compressed "$request"}