Skip to content

Instantly share code, notes, and snippets.

CptSpaceToaster

Block or report user

Report or block CptSpaceToaster

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View timeboat.py
import datetime
import pytest
from freezegun import freeze_time
@pytest.fixture()
def timeboat():
"""Grab the helm of the timeboat, we're going on an adventure!
Allows the test writer to freeze time so that time.time() returns a controlled value
https://stackoverflow.com/a/28073449/4717806"""
View rainbow.sh
PERIOD=300
AMPLITUDE=6000
O1=$((PERIOD/3))
O2=$((O1*2))
UUID=$(osascript -e "tell application \"iTerm2\"
get current session of current window
end tell" | cut -d' ' -f3 -f6 -f10)
set-background() {
View mock.py
#!/usr/bin/env python3
import argparse
import sys
def digest(infile):
for line in infile.readlines():
mock(line)
View gist:e90bde75fcf29bda97a925db0e23eb19
#!/usr/bin/env python3
import argparse
import sys
def digest(infile):
for line in infile.readlines():
makeRegionalChars(line)
@CptSpaceToaster
CptSpaceToaster / something_fishy.py
Last active Nov 13, 2018
Generate a silly fishy-pants themed company name
View something_fishy.py
#!/usr/bin/env python
import random
import argparse
fish = [
'Angle',
'Bait',
'Bob',
View reg.py
#!/usr/bin/env python3
import argparse
import sys
def digest(infile):
for line in infile.readlines():
makeRegionalChars(line)
View Wait... isn't tree wrap called bark?
function wrap_tree()
{
if [[ -f /tmp/tree ]]; then
$(which tree) $*
else
touch /tmp/tree
cat <<EOF
* *
* * *
View mock.py
#!/usr/bin/env python3
import argparse
import sys
def digest(infile):
for line in infile.readlines():
mock(line)
View super_mario_script_2_demoRg
@font-face {
font-family: 'super_mario_script_2_demoRg';
src: url(data:application/font-woff2;charset=utf-8;base64,d09GMgABAAAAAEiUABEAAAAAo1wAAEgrAAEZmQAAAAAAAAAAAAAAAAAAAAAAAAAAP0ZGVE0cGh4GYACDUgg0CYRlEQgKgqNEgf4jATYCJAOGCAuDBgAEIAWFQAeEVQyCPD93ZWJmBhsIjjVy01m5HZAQNd/+UZRu2j6iKOOktWX//9cDJcf2495QihCICQPgGFUzSsawLGJtP1GOKsKDMGrmSPxyWCWlZ8u346/Mr/2GM8fUm+3V7rfVLaQkuyfx99gx3fYkdP+cQgr9032DhAwhAJk4sw6L85/mB/QGWR03L7otYU/LKeLqGYF/KXFcrXGcHLJRSCWj9ZCkqIUn+k7qVWOCWVAnYM2/kytZUx2d+SUMz+vm/0lIAtx7CYGQeyEJkFyQsBJZSsII44apkCArJCAzCRhEEpZoImMluhsctBjQYpXgoCM4a0HtVNva9hU60Ba0X/+r2GX76JJ4Yr+27wzzaE0bIXMNtyTaoDSmU5pXUuWXckkHnfsPpRogkBilP0OAUDUCNl6r18Y/XWvLcPv0b1me/2ljZRGxID988CxQii3uCWrTi9UwqWrkgZdy16pW5R3mzDQtj44BDAvltEf46uXjiQ8lu+VskUAaJZtCoES/o4L9P8xZOpItGBEZMHFgc4A5wra/Rxsc7zA8/MvPvdm48NrlA9Ad6AjrIsWEOfD/5S+z/+KMpHG5W4RDLH0tPRNWvqnLaeokved1G4PQlTvI20AZgUYHfo03wIFCmivtmFoGCiiBmEEpb3acMzhh+4u2uKL/otb929RmtNbT2xkpR0ZUiGhg4dkL33bIEGDVB1ReV1yK+spUx39vqtm+t0vo/q5EpbvsJDmkLvZKTqEoXbp0yf0f6e8uAG+itLsgOQAo+4Al7oRAnQFSZwiUq
View add_song.sh
#!/bin/bash
function get_artist() {
if [[ ! -z "$ARTIST" ]]; then
return
fi
ARTIST=$(mid3v2 "$1" -l | awk -F"=" '/TPE1/ {print $2}')
if [[ ! -z "$ARTIST" ]]; then
return
fi
ARTIST=$(mid3v2 "$1" -l | awk -F"=" '/TPE2/ {print $2}')
You can’t perform that action at this time.