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 elementary.list
==> /etc/apt/sources.list.d/elementary.list <==
deb http://ppa.launchpad.net/elementary-os/stable/ubuntu trusty main
deb-src http://ppa.launchpad.net/elementary-os/stable/ubuntu trusty main
View mock.py
#!/usr/bin/env python3
import argparse
import sys
def digest(infile):
for line in infile.readlines():
mock(line)
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 light.md

ColoredLightsCore Lighting Formats


I confuse myself frequently here. I apologize if I made any incorrect statements in the past. Hopefully, I can write this clearly, and rely on this documentation for the future.

Bit Key:

L = Vanilla Blocklight (kept for backwards compatibility)
S = Vanilla Sunlight (How much sunlight is the block getting... or moonlight)
R = Red Light Channel (Added by CLC)
G = Green Light Channel (Added by CLC)
B = Blue Light Channel (Added by CLC)

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 mock.py
#!/usr/bin/env python3
import argparse
import sys
def digest(infile):
for line in infile.readlines():
mock(line)