Skip to content

Instantly share code, notes, and snippets.

<!-- a countdown timer ending at September 21st 2071
written with vanilla javascript and no external libraries
-->
<html>
<head>
<script type="text/javascript">
// the date to count down to
var targetDate = new Date("September 21, 2071").getTime();
// current date
var currentDate = new Date().getTime();
#sometimes the "best" format that youtube-dl selects changes.
#This causes a second file of the same vid to download if you're archiving entire channels.
#When that happens, this script will clear out the duplicates if the youtube id was included in the filename.
import os
import pandas as pd
from pathlib import Path
from datetime import datetime
from pprint import pprint as pp
def returnDupes(li):
#20210319 - youtube-dl -i <url> to ignore errors is the 100% easier approach over using this script.
#In future, import youtube-dl module and use documentation below to pass parameters
#https://github.com/ytdl-org/youtube-dl/blob/3e4cedf9e8cd3157df2457df7274d0c842421945/youtube_dl/YoutubeDL.py#L137-L312
import re
import os
import shlex, subprocess
from time import sleep
import sys
os.chdir('D:/kingcobrajfs')
from datetime import datetime
timestampDelimiter = '|'
url = 'https://www.youtube.com/watch?v=KUCkrZKslr4'
summary ='''0:00| Welcomes Nikki
0:03| Standup comedy during covid
#word_list = ['hello','there','general','kenobi']
#word = ['hello','there']
import os, os.path as path
os.chdir("E:\\kingcobrajfs")
wordList =[]
with open('wordlist_remove.txt', 'r') as words:
for line in words:
import os, os.path as path
os.chdir("C:/Users/ryan.mcgrath/Desktop/jfs/VTT Files")
fileList = [name for name in os.listdir('.') if os.path.isfile(name) and ".vtt" in name ]
print (fileList)
print(os.getcwd())
lastCap = ""
import webvtt
with open('transcript', 'w') as f:
@piyh
piyh / workingOnMyMachine.py
Created January 6, 2020 00:20
i get to the base flask-admin screen with this gist.
from flask import Flask
from flask_admin import Admin
app = Flask(__name__)
# set optional bootswatch theme
app.config['FLASK_ADMIN_SWATCH'] = 'cerulean'
admin = Admin(app, name='microblog', template_mode='bootstrap3')
# Add administrative views here
player1 = "warlock"
player2 = "oddWarrior"
turnDk1 = 10
turnDk2 = 15
classes = { #bp for base hero power, dk for death knight hero power
"druid":{ "class":"Druid", "bpDamage":1, "bpArmor":1,"bpHeal":0, "bpUse%":.4, "dkDamage":0,"dkArmor":3,"dkHeal":0,"dkuse%":.8},
"oddWarrior":{ "class":"OddWarrior", "bpDamage":0, "bpArmor":4,"bpHeal":0, "bpUse%":.4, "dkDamage":0,"dkArmor":4,"dkHeal":0,"dkuse%":.8},
"hunter":{ "class":"Hunter", "bpDamage":2, "bpArmor":0,"bpHeal":0, "bpUse%":.2, "dkDamage":0,"dkArmor":0,"dkHeal":0,"dkuse%":0},
"mage":{ "class":"Mage", "bpDamage":1, "bpArmor":0,"bpHeal":0, "bpUse%":.1, "dkDamage":1,"dkArmor":0,"dkHeal":0,"dkuse%":.2},
import picamera
import datetime
import json
import time
import numpy
import cv2
import sys
from subprocess import call
import os
import signal
@piyh
piyh / motion_215.py
Created July 7, 2016 02:15 — forked from waveform80/motion_215.py
Motion detection with a circular buffer and file recording in picamera
#!/usr/bin/env python
import io
import time
import picamera
import picamera.array
import numpy as np
from PIL import Image, ImageDraw