Skip to content

Instantly share code, notes, and snippets.

View iamtew's full-sized avatar
🤯
My status? I just found the User Status function!

Mikael 'tew' iamtew

🤯
My status? I just found the User Status function!
View GitHub Profile
@iamtew
iamtew / print256colours.sh
Created December 11, 2022 18:58 — forked from HaleTom/print256colours.sh
Print a 256-colour test pattern in the terminal
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256
@iamtew
iamtew / super_spinner.bash
Created June 14, 2022 19:25 — forked from yarlson/super_spinner.bash
Super Spinner: An Emoji-based spinner for bash
###
# Super Spinner
# An emoji-based spinner — because ASCII is boring.
#
# Usage:
# $ COMMAND & superSpinner $! "Message"
#
# Example:
# $ sleep 5 & superSpinner $! "Sleeping for 5 seconds"
#
@iamtew
iamtew / nginx_userdir.conf
Created October 16, 2015 09:57 — forked from btbytes/nginx_userdir.conf
User-based Website Directories with Nginx
## REF: http://blog.sbf5.com/?p=6
# For requests starting with a tilde, break them into three components:
# 1. The username, everything after the tilde up to the first slash
# 2. The file location, everything after the username up to the last slash
# 3. The trailing slash(es)
# Then, rewrite to go to the f~/ branch.
location /~ {
if ($request_uri ~ ^/~([^/]*)(/.*[^/]|)(/*)$) {
set $homedir $1;
set $filedir $2;