Skip to content

Instantly share code, notes, and snippets.

@djsegal
djsegal / pdf_to_json.py
Last active April 8, 2024 17:16
Convert PDF of CSV file to JSON with hardcoded keys for each entry
import fitz # PyMuPDF
import json
def pdf_to_json(pdf_path, json_path):
doc = fitz.open(pdf_path)
data_list = []
for page_num in range(len(doc)):
page = doc.load_page(page_num)
text = page.get_text().replace("а́\n-", "а́-")
@djsegal
djsegal / custom_setup_language_reactor_for_german.js
Last active April 15, 2024 22:18
File for robustly loading language reactor with german subtitles
let isRepairingTracks = false;
let wasPlaying = false;
let videoLoaded = false;
let isWaiting = false;
function setTracks() {
if (!document.querySelector('video')) {
return;
}
@djsegal
djsegal / Balance.lua
Last active April 29, 2021 21:52
Example boomkin simple rotation
function()
local BL = {
Wrath = 190984,
Starfire = 194153,
EclipseSolar = 48517,
EclipseLunar = 48518,
Starsurge = 78674,
Starfall = 191034,
Sunfire = 93402,
@djsegal
djsegal / Restoration.lua
Last active May 3, 2021 11:04
Example resto druid file for maxdps addon
function()
local BL = {
Wrath = 5176,
Starfire = 197628,
EclipseLunar = 48518,
EclipseSolar = 48517,
Starsurge = 197626,
Sunfire = 93402,
Moonfire = 8921,
@djsegal
djsegal / 10000-MTV-Music-Artists-page-1.csv
Created October 13, 2020 22:29 — forked from mbejda/10000-MTV-Music-Artists-page-1.csv
10,000 MTV's Top Music Artists. Great dataset for machine learning, research and analysis. (name,facebook,twitter,website,genre,mtv).
name facebook twitter website genre mtv
Adele http://www.facebook.com/9770929278 http://www.twitter.com/officialadele Pop http://www.mtv.com/artists/adele/biography
Joey + Rory http://www.facebook.com/15044507815 http://www.twitter.com/joeyandrory Country http://www.cmt.com/artists/joey-rory/biography
Draaco Aventura http://www.facebook.com/856796091053581 http://www.twitter.com/DraacoAventura http://www.bandpage.com/draacoaventura Pop Latino http://www.mtv.com/artists/draaco-aventura/biography
Justin Bieber http://www.facebook.com/309570926875 http://www.twitter.com/justinbieber http://www.justinbiebermusic.com Pop http://www.mtv.com/artists/justin-bieber/biography
Peer van Mladen http://www.facebook.com/264487966 http://www.twitter.com/Predrag_Jugovic http://pejaintergroup.eu/Peer_van_Mladen.html House http://www.mtv.com/artists/peer-van-mladen/biography
Chris Janson http://www.facebook.com/296647641825 http://www.twitter.com/janson_chris http://www.chrisjanson.com Country http://www.cmt.com/a
@djsegal
djsegal / Fusion Energy.ipynb
Created June 6, 2020 22:54
Comparing Pulsed and Steady-State Tokamaks
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@djsegal
djsegal / colors.jl
Created May 8, 2020 00:05
Simple color parser for hex and HTML colors to RGB array
global_colors = Dict(
"aliceblue" => [240, 248, 255],
"antiquewhite" => [250, 235, 215],
"aqua" => [0, 255, 255],
"aquamarine" => [127, 255, 212],
"azure" => [240, 255, 255],
"beige" => [245, 245, 220],
"bisque" => [255, 228, 196],
"black" => [0, 0, 0],
"blanchedalmond" => [255, 235, 205],
@djsegal
djsegal / covid-seir.ipynb
Last active May 9, 2020 08:06
A Live SEIR Model for Covid-19 with Error Bars in Julia
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@djsegal
djsegal / missing-image.html
Created April 16, 2020 22:56 — forked from oscarmorrison/missing-image.html
html backup image
<img src="img/missing-image.png" onerror="javascript:this.src='img/default.png'">
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.