Skip to content

Instantly share code, notes, and snippets.

Avatar

CptSpaceToaster

View GitHub Profile
View mock.py
#!/usr/bin/env python3
import argparse
import sys
def digest(infile):
for line in infile.readlines():
mock(line)
@CptSpaceToaster
CptSpaceToaster / simple_tcgplayer.py
Last active Dec 10, 2020
A very simple demonstration of TCGPlayer's API.
View simple_tcgplayer.py
import os
import requests # pip install requests
TCGPLAYER_API_URL = 'https://api.tcgplayer.com'
TCGPLAYER_API_VERSION = 'v1.39.0'
# https://able.bio/rhett/how-to-set-and-get-environment-variables-in-python--274rgt5
TCGPLAYER_PUBLIC_KEY = os.environ.get('TCGPLAYER_PUBLIC_KEY')
TCGPLAYER_PRIVATE_KEY = os.environ.get('TCGPLAYER_PRIVATE_KEY')
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)