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 / schillbot_corpus.txt
Last active June 15, 2020 21:45
schillbot_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 N 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, “he gets paid to b
@sneakers-the-rat
sneakers-the-rat / random_address.py
Created June 25, 2020 20:09
generate random address
import os
import io
import zipfile
import requests
import pandas as pd
import pdb
def download_addresses(path='lane.csv'):
print('Downloading addresses')
lane_addresses_zip = requests.get(
@sneakers-the-rat
sneakers-the-rat / kip_hmm.ipynb
Last active July 24, 2020 01:56
Kip - loading data pythonically
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sneakers-the-rat
sneakers-the-rat / scrape_courses.py
Last active July 24, 2020 07:19
scrape uo course catalogue
import requests
from bs4 import BeautifulSoup as bs
import pandas as pd
import tqdm
import datetime
import os
import pickle
def scrape_crn(crn, page_dir):
url = f"https://classes.uoregon.edu/duckweb/hwskdhnt.p_viewdetl?term=202001&crn={crn}"
@sneakers-the-rat
sneakers-the-rat / gist:0d17da7c9297ca1d33b23fa33086c3a4
Created January 2, 2021 05:14
use acme to issue and maintain a cert on cpanel
# curl https://get.acme.sh | sh
./.acme.sh/acme.sh --force --issue -d website.com -d www.website.com -w /home/nod3bp3usey4/public_html/website_path
./.acme.sh/acme.sh --deploy -d website.com -d www.website.com --deploy-hook cpanel_uapi
@sneakers-the-rat
sneakers-the-rat / yt-dl.sh
Created January 6, 2021 23:24
using youtube dl
###########
# Mac
# (copy and paste these into your Terminal (Open Terminal from Applications > Utilities > Terminal)
# 1. install homebrew if you haven't already
# https://brew.sh/
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# 2. install youtube-dl
brew install youtube-dl
@sneakers-the-rat
sneakers-the-rat / remove_meta.sh
Last active July 16, 2024 10:34
remove pdf metadata
####
# 1) install exiftool and qpdf
# https://exiftool.org/
# http://qpdf.sourceforge.net/
# (can be installed with homebrew: brew install exiftool qpdf )
####
# 2) remove metadata - this step is reversible, so we will need to recreate the PDF afterwards
exiftool -all:all= /location/of/some/file.pdf
@sneakers-the-rat
sneakers-the-rat / grid_search_ssm.ipynb
Created March 12, 2021 00:01
grid_search_ssm.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
protocol = [
{
"allow_repeat": False,
"graduation": {
"type": "n_trials",
"value": {
"current_trial": "0",
"n_trials": "200",
"type": "n_trials"
}
@sneakers-the-rat
sneakers-the-rat / _profile_jekyll.rb
Created October 5, 2021 20:59
Profile Jekyll Build with ruby-prof
require "jekyll"
require "ruby-prof"
result = RubyProf.profile do
# you can set any of the --options you'd pass to build here
# it will automatically pick up the _config.yml file in source
options = {
"source" => './',
"destination" => './_site',