Skip to content

Instantly share code, notes, and snippets.

.git/
build
dist
*.egg-info
*.egg/
*.pyc
*.swp
.tox
@dgnsrekt
dgnsrekt / td-read.py
Created June 5, 2020 01:33
Playing around with tdameritrade stream api.
import pandas
from decouple import config
from time import sleep
DATABASE_URI = config("DATABASE_URI")
while True:
table = pandas.read_sql_table("chartdata", DATABASE_URI)
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[packages]
logme = "*"
python-decouple = "*"
[dev-packages]
import nox
from pathlib import Path
PROJECT_ROOT_DIR = Path(__file__).parent
PROJECT_BIN_DIR = PROJECT_ROOT_DIR / "bin"
FFMPEG_DIR = PROJECT_BIN_DIR / "ffmpeg-stable"
DOWNLOAD_COMPRESSED_FILE = "ffmpeg-git-amd64-static.tar.xz"
DOWNLOAD_URL = "https://johnvansickle.com/ffmpeg/builds/" + DOWNLOAD_COMPRESSED_FILE
FFMPEG_BIN = FFMPEG_DIR / "ffmpeg"
from pathlib import Path
from os import walk
import bson
# ^------ pip install bson
# This is a concept for walking through a folder with nested folders each contaning files.
# This can easily be modified to take in a list of mutliple target folders
@dgnsrekt
dgnsrekt / idea.py
Last active November 4, 2019 05:17
from abc import ABCMeta
from cv2 import VideoCapture, CAP_PROP_FRAME_COUNT
from cv2 import imshow
from pathlib import Path
VALID_VIDEO_FORMATS = [".avi", ".flv", ".mov", ".mp4", ".wmv", ".mkv"]
VALID_IMAGE_FORMATS = [".bmp", ".jpg", ".png"]
VALID_MEDIA_FORMATS = VALID_VIDEO_FORMATS + VALID_VIDEO_FORMATS
from subprocess import Popen, PIPE, STDOUT, run, check_output
from pathlib import Path
from shlex import split
from random import randint, choice
import sys
PITCH = {
"A": 27.500,
"Bb": 29.135,
"A#": 29.135,
from subprocess import Popen, PIPE, STDOUT, run
from pathlib import Path
from shlex import split
from random import randint
import sys
frequency = 400
seconds = 5
channels = 2
sequence_length = 100
from urllib.request import urlopen
from tkinter import *
from time import sleep
from random import choice
URL = "https://blockchain.info/q/getblockcount"
COLORS = ["yellow", "orange", "red"]
FONT = ("helvetica", 100, "bold")
def update_clock(previous=None):
alsabat -F 440 -n 10000 -c 1 -f cd -c 2 -P plughw:2,0