Skip to content

Instantly share code, notes, and snippets.

View austintraver's full-sized avatar

Austin Traver austintraver

View GitHub Profile
@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... ")
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 / 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
@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 / 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 / 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 / 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 {
#include <stdio.h>
#include <stdint.h>
int main(int argc, char** argv) {
printf("Hello world!\n");
return 0;
}
@austintraver
austintraver / helper.py
Last active July 28, 2020 00:14
Grading script for CSCI 201 HW #2
from sys import argv
from subprocess import run
import datetime
import re
origin = None
index = 0
easy=[
0,
1.2,
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
public class Timer {
public static void main(String[] args) {
/* Get the current time */
LocalTime localTime = LocalTime.now();