Skip to content

Instantly share code, notes, and snippets.

View austintraver's full-sized avatar

Austin Traver austintraver

View GitHub Profile
#include <stdio.h>
#include <stdint.h>
int main(int argc, char** argv) {
printf("Hello world!\n");
return 0;
}
@austintraver
austintraver / manpager.sh
Last active September 29, 2020 03:36
Read manpages inside vi
typeset -Hgx
# If `nvim` is installed
if (( ${+commands[nvim]} )) {
# Have `vi` refer to `nvim`
alias vi='nvim'
# open manpages using `nvim`
MANPAGER='nvim +Man!'
} else {
@austintraver
austintraver / books.md
Created October 4, 2020 10:14
The top 100 books of all time
  1. Melville, Moby Dick.
  2. Dostoyevsky, Crime and Punishment.
  3. Dostoyevsky, The Brothers Karamazov.
  4. The Bible
  5. Joyce, Ulysses.
  6. Nabokov, Lolita.
  7. Williams, Stoner.
  8. Pynchon, Gravity's Rainbow.
  9. Homer, The Iliad.
  10. Wallace, Infinite jest.
@austintraver
austintraver / fontastic.sh
Created October 4, 2020 11:43
Download fonts straight from your CLI
# usage: `zsh ./fontastic.sh 'Open Sans'`
font_family=${1/ /+}
font_weights=({1..9}00{,b,i,bi})
base_url='https://fonts.googleapis.com/css'
query_string="family=${font_family}:${(j<,>)font_weights}"
endpoint="${base_url}?${query_string}"
fonts=($(curl -s ${endpoint} | grep -o 'https://.*\.ttf' ))
names=(${(f)"$(curl -s ${endpoint} | grep '^ src' | sed "s/^.*src: local('\([^']\+\)').*$/\1/")"})
if (( ${#fonts} > 0 )) {
mkdir -v ${1}
@austintraver
austintraver / README.css
Last active April 21, 2021 20:12
Custom style sheet that replicates the look of GitHub's rendering of markdown files
body {
background-color: white;
}
@austintraver
austintraver / zshrc.sh
Last active July 13, 2021 13:59
A set of sensible defaults for a shell environment running on a remote host.
# _
# _______| |__ _ __ ___
# |_ / __| '_ \| '__/ __|
# / /\__ \ | | | | | (__
# /___|___/_| |_|_| \___|
# ========================
# Share command history between active shell sessions
setopt SHARE_HISTORY
not android > 0
not and_ff > 0
not and_uc > 0
not and_qq > 0
not opera > 0
not op_mini > 0
not op_mob > 0
not baidu > 0
not kaios > 0
not samsung > 0
@austintraver
austintraver / loading.go
Created March 10, 2021 23:07
A colorful loading bar, written in Go
package main
import "fmt"
import "time"
import "strconv"
import "strings"
func loading() {
for {
fmt.Printf("\n\x1b[2F\x1b[1BLoading... ")
@austintraver
austintraver / cling.sh
Created March 22, 2021 00:47
Configure LLVM & Clang as the default C/C++ developer toolchain
function cling {
if (( ${#} != 1 )); then
echo "usage: \`cling VERSION\` " >&2
return 1
fi
typeset version=${1}
typeset priority=$(( ${version} * 10 ))
@austintraver
austintraver / zshcontrib.1
Last active April 7, 2021 08:05
Markdown of zshcontrib(1) converted back into `man` format
.TH "ZSHCONTRIB" "1" "February 14, 2020" "" ""
.hy
.SH NAME
.PP
zshcontrib - user contributions to zsh
.SH DESCRIPTION
.PP
The Zsh source distribution includes a number of items contributed by the user
community.
These are not inherently a part of the shell, and some may not be available in