Skip to content

Instantly share code, notes, and snippets.

View tenkabuto's full-sized avatar
🤓
Contributing to a project

Brandon Hall tenkabuto

🤓
Contributing to a project
View GitHub Profile
@tenkabuto
tenkabuto / channels_sans_socials.csv
Last active September 6, 2020 09:45
All website channels on the Brave Publishers network (as of approx. August 8, 2020; all social channels removed)
We can't make this file beautiful and searchable because it's too large.
"url"
"heliat.fr"
"linuxiarze.pl"
"decryptonauten.nl"
"tech-hardware.it"
"kryptoinformator.pl"
"bearmountainmarketing.com"
"geek17.com"
"birthdayfrenzy.com"
"romeocrow.com"
@tenkabuto
tenkabuto / app.py
Last active March 27, 2019 01:53
Tree example for Toga, with print out (to terminal) of what's currently selected in the tree when you click on either a row with a Title or click the button Insert Row
from random import choice
import toga
from toga.style import Pack
from toga.constants import ROW, COLUMN
bee_movies = [
{'year': 2008, 'title': 'The Secret Life of Bees', 'rating': '7.3', 'genre': 'Drama'},
{'year': 2007, 'title': 'Bee Movie', 'rating': '6.1', 'genre': 'Animation, Adventure, Comedy'},
{'year': 1998, 'title': 'Bees', 'rating': '6.3', 'genre': 'Horror'},
@tenkabuto
tenkabuto / PocketMod-Transform-Script.sh
Last active May 23, 2018 20:31
Requires ImageMagick and pdftk. Produced by @court-jus. Takes an 8 page PDF and transforms it into a PocketMod booklet! Found at: https://boardgamegeek.com/thread/803592/best-way-make-pocketmod
#!/bin/bash
filename=$1
basefilename=$(basename ${filename})
tmpdir=$(mktemp -d -t)
cp ${filename} ${tmpdir}/
cd ${tmpdir}
@tenkabuto
tenkabuto / base.ipynb
Created April 12, 2018 23:44
The base for an interactive Econ Notebook in Jupyter
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tenkabuto
tenkabuto / unlikr.py
Last active January 29, 2018 08:50
"Unlikr" - modified from Brandon DeRosier's (@bdero) code at http://blog.cheesekeg.com/unlikr-unlike-everything-on-tumblr
#!/usr/bin/env python
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
from time import sleep
from sys import argv
find_likes = lambda browser: browser.find_elements_by_css_selector('.post_control.like.liked')
def find_next_page(browser):
try:
@tenkabuto
tenkabuto / gist:2d18acf93979f6f745da5af639a20e0c
Created December 29, 2017 23:59 — forked from strangerstudios/gist:5573829
Paid Memberships Pro customization to only let members of a certain level checkout if a discount code was used.
/*
Only let level 1 members sign up if they use a discount code.
Place this code in your active theme's functions.php or a custom plugin.
*/
function my_pmpro_registration_checks_require_code_to_register($pmpro_continue_registration)
{
//only bother if things are okay so far
if(!$pmpro_continue_registration)
return $pmpro_continue_registration;
@tenkabuto
tenkabuto / my_template_redirect_upgrade.php
Last active December 29, 2017 20:21 — forked from strangerstudios/my_template_redirect_upgrade.php
Redirect away from the checkout page if you don't have a required level with Paid Memberships Pro.
/*
Redirect away from the checkout page if you don't have a required level.
*/
function my_template_redirect_upgrade()
{
global $pmpro_pages, $pmpro_level;
if(empty($pmpro_pages))
return;
@tenkabuto
tenkabuto / 2017Fall-research-CV-data-kelly-class.md
Last active September 25, 2017 21:41
Research for CV project in Kelly's class
@tenkabuto
tenkabuto / Crosstab to Dataframe.r
Last active August 5, 2017 22:52
Crosstab (contingency table) to Dataframe
# Read in CSV file that's formatted as a Crosstab (empty top left cell, top row contains column names and first column contains row names)
# `header = T` pulls column names from first row
# `row.names = 1` pulls row names from first column, so starts from 1, not 0
b2009 <- read.csv("20092009 Beer - CrossTab.csv", header = T, row.names = 1)
table <- as.table(as.matrix(b2009))
test <- data.frame(table)
# Add names to Columns, starting from leftmost column
colnames(test) <- c("Beer","Judge","Rating")
@tenkabuto
tenkabuto / Related Clubs.sql
Created June 8, 2017 21:40
Getting Related Clubs with Data Science Club (`125525`) for Test