Skip to content

Instantly share code, notes, and snippets.

View beefy's full-sized avatar
✌️

Nate Schultz beefy

✌️
  • Zendesk
  • Philadelphia, PA
  • 05:36 (UTC -04:00)
View GitHub Profile
# by convention the first makefile target
# compile, run the problems, then clean up
all: compile run
# compile all of the files
# and execute them
run:
java -cp ./build/classes main/Checkers
# compile all of the files
@beefy
beefy / parse2.py
Last active February 5, 2019 00:08
parse chess pgn metadata into python dict
import matplotlib.pyplot as plt
import datetime
import numpy as np
from datetime import datetime
games = []
rec= {}
keys = [
"[Event ","[Site ","[Date ","[Round ","[White ","[Black ",
"[Result ","[UTCDate ","[UTCTime ","[WhiteElo ","[BlackElo ",
@beefy
beefy / plot_chess_data.py
Created September 3, 2018 15:07
use matplotlib on lichess data
import matplotlib.pyplot as plt
import datetime
import numpy as np
from datetime import datetime
games = []
rec= {}
keys = [
"[Event ","[Site ","[Date ","[Round ","[White ","[Black ",
"[Result ","[UTCDate ","[UTCTime ","[WhiteElo ","[BlackElo ",
@beefy
beefy / chess_game_to_gif.py
Last active January 2, 2021 14:43
convert a chess pgn file to a gif
import chess.pgn
import chess.svg
import subprocess
import lichess.pgn
import lichess.api
import os
import io
import imageio
import numpy as np
import cv2
@beefy
beefy / solidity_build_docs.md
Created May 1, 2021 01:28
Run Solidity Locally Linux/Ubuntu
@beefy
beefy / video_markov.py
Last active December 15, 2021 04:34
Work in progress: create a markov chain for a video to generate new frames
import os
import io
import cv2
import math
import matplotlib.pyplot as plt
import pandas as pd
from tensorflow.keras.preprocessing import image_dataset_from_directory
import numpy as np
from keras.utils import np_utils
from skimage.transform import resize
@beefy
beefy / generate.py
Created February 10, 2022 13:35
Generate text based on pdf files
import pickle
import random
with open("markov.pickle", "rb") as f:
markov = pickle.load(f)
length = 500
initial_word = random.choice(list(markov.keys()))
output = initial_word.decode("ascii", "ignore") + " "
previous_word = initial_word