Skip to content

Instantly share code, notes, and snippets.

View grantoz's full-sized avatar

Grant Ozolins grantoz

View GitHub Profile
@grantoz
grantoz / gist:5ab56eba6c7b3df9ae4c3c3c9393e41b
Created March 10, 2023 02:37
Basic UTF-8 web page with SVG emoji favicon
<!doctype html>
<html lang="en">
<head>
<link rel="icon" href='data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y=".9em" font-size="90">🎉</text></svg>'>
<meta charset="utf-8">
<title>You Are Here</title>
</head>
<body>
<h2>Congratulations, you are reading a web page.</h2>
<p style="font-size: 80px">🎉🚀</p>
@grantoz
grantoz / disable_all_animation.sh
Created January 5, 2021 23:27 — forked from lexrus/disable_all_animation.sh
Disable all animations of OS X.
# opening and closing windows and popovers
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false
# smooth scrolling
defaults write -g NSScrollAnimationEnabled -bool false
# showing and hiding sheets, resizing preference windows, zooming windows
# float 0 doesn't work
defaults write -g NSWindowResizeTime -float 0.001
# add this to ~/.zshrc to load homebrew zsh on demand, rather than making each shell start more slowly
# modified from http://broken-by.me/lazy-load-nvm/ to use brew nvm
export NVM_DIR="$HOME/.nvm"
if [[ $(uname -m) = "intel" ]]
then
export NVM_OPT="/usr/local/opt/nvm" # intel
else
export NVM_OPT="/opt/homebrew/opt/nvm" # arm64 / aarch64
fi
@grantoz
grantoz / hastat
Created June 29, 2020 13:51
hastat - create local port forwarding to haproxy stats port, and open web interface in one command
#!/bin/bash
if (( $# < 2 )); then
echo usage: `basename $0` ssh-user host
exit 1
fi
ssh -f -N -L 1080:127.0.0.1:8011 ${1}@${2}
open http://localhost:1080/admin/stats
echo -n "pid "; pgrep 1080:127.0.0.1:8011
@grantoz
grantoz / brewdeps
Last active July 13, 2021 03:53
List homebrew dependencies for all installed packages
#!/bin/bash
brew list --formula | while read f
do
echo -e -n "\033[1;36m${f}\033[0m"
brew deps $f | awk '{printf(" %s ", $0)}'
echo ""
done

Keybase proof

I hereby claim:

  • I am grantoz on github.
  • I am grantoz (https://keybase.io/grantoz) on keybase.
  • I have a public key ASChk2ul0ALNmpflJyNDCbYGreIPTYdTWhmjRLaWiZRAkwo

To claim this, I am signing this object: