Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan Fleck RyanFleck

View GitHub Profile
View snek.py
import os
import random
import enum
import cherrypy
"""
Dumb battlesnake, picks a clear path.
For instructions see https://github.com/BattlesnakeOfficial/starter-snake-python/README.md
"""
View transcribe_video.py
# transcribe_video.py
# A script to strip the audio from a video, split the audio into chunks, and send
# each chunk through the Google voice-to-text library to get the transcript.
# Requires: pydub, moviepy, numpy==1.19.3
# FFMPEG must also be installed on the system.
# Tested on Windows 10.
import speech_recognition as sr
View transcribe_mp3.py
import os
import speech_recognition as sr
from pydub import AudioSegment
from pydub.silence import split_on_silence
r = sr.Recognizer()
r.energy_threshold = 300
def clean_text(text:str):
View prismatic-profiles.py
#!/usr/bin/python3
from PIL import Image, ImageDraw, ImageFont, ImageFilter
from sys import exit
import random
"""
This is a script to demonstrate profile image generation for wise users.
View PR-ExpandR.js
// ==UserScript==
// @name PR ExpandR
// @namespace http://ryanfleck.ca/
// @version 1.0
// @description Expand all GitHub PR conversations.
// @author Ryan Fleck
// @match https://github.com/*/pull/*
// ==/UserScript==
var interval = 3000;
@RyanFleck
RyanFleck / elg_plot_csvs_v2.py
Last active Feb 11, 2020
For a set of *.csv files, return *.png graphs of the first and third columns with different colors.
View elg_plot_csvs_v2.py
import numpy as np
import matplotlib.pyplot as plt
import csv
import glob
import os
print("Gathering CSVs...")
csvFiles = sorted(glob.glob(os.getcwd() + "/*.csv"))
numpyFileData = []
@RyanFleck
RyanFleck / elg_plot_csvs.py
Created Feb 11, 2020
Given a folder of CSV files, return a .png for each with the plotted values.
View elg_plot_csvs.py
import numpy as np
import matplotlib.pyplot as plt
import csv
import glob
import os
print("Gathering CSVs...")
csvFiles = sorted(glob.glob(os.getcwd() + "/*.csv"))
numpyFileData = []
View scram.py
import random
while(True):
x = input(">>> ")
x = list(x)
y = []
for char in x:
if char == " ":
y.append(" ")
else:
View half-adder.vhd
--- CEG3155 Lab 2 material.
library IEEE;
use IEEE.Std_Logic_1164.all;
entity halfadder is
port (
A, B : in std_logic;
sum, carry : out std_logic
);
View DebouncedInterrupt.ino
/*
Ryan Fleck
Interrupt Programming Tests
*/
// Light for testing feedback.
const byte ledPIN = 13;
// Interrupt pin zero is digital pin 2.
const byte interruptPIN = 2;