Skip to content

Instantly share code, notes, and snippets.

View jakebox's full-sized avatar
🦎
At school

Jacob Boxerman jakebox

🦎
At school
View GitHub Profile
@jakebox
jakebox / analyze_hamlet.py
Created December 18, 2021 16:16
Program written to analyze character line counts in Hamlet.
import matplotlib.pyplot as plt
scene_file = "scene_iv.txt"
# Character: number of lines spoken
characters = {"LORD POLONIUS": 0, "QUEEN GERTRUDE": 0, "HAMLET": 0}
def count_characters_lines():
last_character = ""
with open(scene_file) as file: # Use file to refer to the file object
text = file.read().splitlines()
@jakebox
jakebox / calc-speaking-time.el
Last active August 31, 2021 01:36
Simple Emacs function to calculate the speaking time of a selection of text. Replace '150' with your average speaking time.
(defun jib/calc-speaking-time ()
"Calculate how long it would take me to speak aloud the selection."
(interactive)
(if (use-region-p) (let* ((wpm 150)
(word-count (float (count-words-region (region-beginning) (region-end))))
(raw-time (* 60 (/ word-count wpm))))
(message "%s minutes, %s seconds to speak at %d wpm"
(format-seconds "%m" raw-time)
(floor(mod raw-time 60)) wpm))
(error "Error: select a region.")))
// ==UserScript==
// @name Ancestry Add Relative Shortcut
// @namespace jakebox.scripts
// @match *://*.ancestry.com/*
// @grant none
// @version 1.0
// @author Jake B, www.github.com/jakebox
// @description 12/25/2020, 4:46:35 PM
// ==/UserScript==
/*******************************************************************************
* ROFI Jake Theme
* User: Jake
* Copyright: Also jake but idc
*******************************************************************************/
* {
active-background: #6674AD;
active-foreground: @foreground;
normal-background: @background;
@jakebox
jakebox / images_downloader.py
Last active April 3, 2022 00:58
Automates clicking on images in Google Images, saving them, and saving their link. A program I wrote to download a bunch of images to make a video for history class that required source links.
###
### Google Images photo & link saver
### By Jake B - May 2020
###
import clipboard as clipboard
import pyautogui as pag
import time
f = open("sources.txt", "a")
@jakebox
jakebox / .bashrc
Created December 29, 2019 06:23
Bash Prompt
export PS1="\[\033[38;5;247m\]\u\[$(tput sgr0)\]\[\033[38;5;15m\]@\[$(tput sgr0)\]\[\033[38;5;246m\]\h\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]\[\033[38;5;38m\][\[$(tput sgr0)\]\[\033[38;5;197m\]\w\[$(tput sgr0)\]\[\033[38;5;39m\]]\[$(tput sgr0)\]\[\033[38;5;6m\]:\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]"
@jakebox
jakebox / pdf_parser.py
Last active April 3, 2022 00:58
PDF Downloader/Reader
###
### PDF Parser/Downloader
### By Jake B - December 2019
###
import os
import requests
import PyPDF2
import re
@jakebox
jakebox / spreadsheet_retrieve.py
Last active April 3, 2022 00:58
Google Sheets Retriever
###
### Google Sheets Data Retriever
### By Jake B - December 2019
### Uses gspread and Google Drive API to retrieve
### data from Google sheets spreadsheet
###
import gspread
from oauth2client.service_account import ServiceAccountCredentials