Skip to content

Instantly share code, notes, and snippets.

View sneakers-the-rat's full-sized avatar

Jonny Saunders sneakers-the-rat

View GitHub Profile
@sneakers-the-rat
sneakers-the-rat / schill.json
Last active April 11, 2019 20:17
schill corpus
[
"Dear Colleagues, Universities today face headwinds from a multitude of sources. In the political sphere, one party castigates us for being ideologically unbalanced and intolerant of free speech and the other for being unaffordable and elitist. Trust in universities is battered by a deluge of criticism and well-publicized scandals involving sexual violence, administrative misfeasance, and admissions improprieties. Political support has diminished with public trust. Many public universities, including the University of Oregon, never recovered from the 2008 recession in terms of state funding. Underfunded pension plans, skyrocketing health-care costs, and skepticism about our mission and operation have created tremendous pressure on our twin missions of education and research. Despite these challenges, I am incredibly optimistic about the future of higher education, generally, and at the University of Oregon, in particular. I know some of you will read this, roll your eyes, and think to yourself, \u201cHe g
@sneakers-the-rat
sneakers-the-rat / fanfiction.py
Created May 6, 2019 09:02
scraping fanfiction.com
import requests
from bs4 import BeautifulSoup as bs
from tqdm import tqdm
import json
import os
import tables
import numpy as np
import pdb
import traceback
@sneakers-the-rat
sneakers-the-rat / heart_on_yr_sleeve.R
Created July 17, 2019 21:11
google sheets for classroom surveys
library(googlesheets)
library(tidyverse)
# get spreadsheet key
#sheet_key <- extract_key_from_url("https://docs.google.com/spreadsheets/d/e/2PACX-1vRyiiW8T0JFOnycEhQM6WaoUgcA_5xpO5xe-x0ifhI38XfmOpAuUvbtMCw8Lg6CuX5W--wbh0XFk9KU/pubhtml")
# stash so it dont crash during class
sheet_key <- "1TbkdZ_FSdf-PBqPwNBFcEVCANVgb1xgXv70GhqjmWrk"
# download sheet
emotions_raw <- gs_key(sheet_key) %>% gs_read()
@sneakers-the-rat
sneakers-the-rat / insurance_swindle.py
Created October 6, 2019 04:42
UO's 'marginal' health insurance proposal
# modeling this ridiculous healthcare proposal
import numpy as np
import matplotlib.pyplot as plt
def healthcare(steps=11, initial_cost=2500000., mean_increase=6., sd_increase=2.):
# stash initial values
cost = initial_cost
uo_cost = cost*0.95
increase_pct = 0.
@sneakers-the-rat
sneakers-the-rat / wwe.txt
Last active December 15, 2019 03:27
wwe_corpus
Welcome to Wrestlemania!
Woodstock was to rock and roll, what WrestleMania is to wrestling.
Finally, your men, in a very controversial match...
What do you mean "controversial"? He pinned him right in the center of the ring, didn't he? Did he or did he not pin him for the count of three?
Where's that cane of yours?
What cane? I...didn't have no cane!
All right, we're just moments away from the big one. When I say big, the battle of the titans. Big John Studd, Bobby Heenan, come in. Andre the Giant putting his entire career on the line.
Oh man, this bag is heavy man! This is what it was all about. $15,000 that we used for bait. John Studd, the only giant of wrestling. 7 foot plus, nearly 400 pounds of solid muscle. And this is what we wanted to prove to the whole world that I am the giant in a few short moments, along with this $15,000. You're going to see me in the ring and you're going to see the last match of Andrea because he retires if he can't do it.
Bobby Heenan, I'm just counting the money here.
You kn
@sneakers-the-rat
sneakers-the-rat / Makefile
Last active March 20, 2020 21:51
Configuration for Model M with Soarer's Converter
# build all sctools for Mac OS-X
OS = MACOSX
CC = gcc
STRIP = strip
SDK = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
CFLAGS = -O2 -Wall -isysroot $(SDK) -D$(OS) -arch x86_64
LIBS = -Xlinker -syslibroot -Xlinker $(SDK) -framework IOKit -framework CoreFoundation
@sneakers-the-rat
sneakers-the-rat / nyt_trail.js
Created February 27, 2020 08:52
gotta trail somethin
/*
idk why but u can run this on
https://www.nytimes.com/interactive/2020/02/25/us/politics/democratic-debate-south-carolina.html
uses some modified code from
http://www.howtocreate.co.uk/tutorials/jsexamples/multitrail.html
the nyt site loadez the jquery so yno this wasn't built to be reusable.
@sneakers-the-rat
sneakers-the-rat / install_jamovi.sh
Last active April 9, 2020 07:29
jamovi on chromebook
#!/bin/bash
#https://dev.jamovi.org/info_project-structure.html
sudo apt update
sudo apt upgrade
sudo apt install build-essential r-base protobuf-compiler npm python3-dev python3-pip libboost-all-dev libnanomsg-dev libnss3
pip3 install Cython tornado google-api-python-client pyyaml chardet scipy nanomsg
sudo R -e "install.packages(c('RInside', 'jmvtools'), repos=c('https://repo.jamovi.org', 'https://cran.r-project.org'))"
@sneakers-the-rat
sneakers-the-rat / install_jamovi_simpler.sh
Created April 9, 2020 08:23
install jamovi on chromebook simpler
#!/bin/bash
sudo apt update
sudo apt upgrade -y
sudo apt install -y flatpak
flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install -y --user org.jamovi.jamovi
# create a terminal command to launch jamovi
@sneakers-the-rat
sneakers-the-rat / pasta.R
Created April 26, 2020 22:28
pasta types
library(tidyverse)
library(factoextra)
# length/diameter - cm, diameter is major
# eccentricity - minor/major
# pitch - turns/cm
# toroidal, corrugated - boolean
# envelope - boolean - diameter deviation longitudinally,
pasta <- tribble(