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~,~,
@bradbeattie
bradbeattie / netflix.js
Last active January 25, 2018 06:53
Adds IMDB ratings to netflix
var OMDB_APIKEY = "..."
var omdb_searched = new Set()
var omdb_netflix_id_regex = new RegExp("/watch/([0-9]+)")
function omdb_get_key(link) {
return "omdb" + omdb_netflix_id_regex.exec(link.prop("href"))[1]
}
function omdb_find_cards() {
jQuery(".meta > .year").each(function() {
@bradbeattie
bradbeattie / prep-python-env.sh
Last active February 4, 2018 04:04
prep-python-env.sh
#!/bin/bash
DIR=$(pwd)
# Download Python
PYTHON_VERSION="3.6.4"
PYTHON_VERSION_SHORT="3.6"
PYTHON_DOWNLOAD_URL="https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz"
PYTHON_DOWNLOAD_FILE="Python-$PYTHON_VERSION.tgz"
curl $PYTHON_DOWNLOAD_URL > $PYTHON_DOWNLOAD_FILE
PYTHON_MD5SUM_EXPECTED="9de6494314ea199e3633211696735f65"
@bradbeattie
bradbeattie / pycon-preference-displayer.js
Last active April 20, 2017 16:57
PyCon Preference Displayer
// To be used on https://us.pycon.org/2017/schedule/talks/
// after using https://gist.github.com/bradbeattie/8d346acda2d737ef23ccf9cc78fd80d7
// Display the recorded preference for each talk
// To be used in tandem with
$(".slot-talk .title a").each(function() {
var element = $(this)
var href = element.attr("href")
if (localStorage[href] !== undefined) {
element.parents(".slot-talk").css("background", "hsl(" + ((parseInt(localStorage[href]) + 5) * 10) + ", 50%, 50%)")
@bradbeattie
bradbeattie / pycon-preference-recorder.js
Last active April 20, 2017 16:56
PyCon Preference Recorder
// To be used on https://us.pycon.org/2017/schedule/talks/list/
// Hide who's giving the talk and when
$("h2 + p").remove()
// On left and right click, increase or decrease the recorded preference for the talk
function process(event, element, left) {
event.preventDefault()
event.stopPropagation()
var href = element.prev().find("a").attr("href")
#!/usr/bin/env python3
from getpass import getpass
import argparse
import base64
import hashlib
import json
import logging
import os
import secrets
@bradbeattie
bradbeattie / queryset_filters.py
Created July 19, 2016 17:02
Django queryset understanding confirmation
#$ cat myapp/models.py
#from django.db import models
#
#class Foo(models.Model):
# pass
#
#class Bar(models.Model):
# foos = models.ManyToManyField(Foo, related_name="bars")
# val_a = models.BooleanField()
# val_b = models.BooleanField()
@bradbeattie
bradbeattie / ast_parser.py
Created June 24, 2016 20:38
Python AST parser
import ast
import operator as op
# Supported tokens and their operators
operators = {
ast.Add: op.add,
ast.Sub: op.sub,
ast.Mult: op.mul,
ast.Div: op.truediv,
}
@bradbeattie
bradbeattie / throttle.py
Last active June 24, 2016 20:47
Demonstration of cache-based action throttling
import memcache
from hashlib import sha1
from datetime import datetime
cache = memcache.Client(["127.0.0.1:11211"])
class ActionThrottled(Exception):
pass
@bradbeattie
bradbeattie / They Come Unseen.md
Last active March 8, 2017 18:54
Rules Confirmation Scenario for They Come Unseen

They Come Unseen: Rules Confirmation Scenario

This is not meant to be a comprehensive list of rules, but instead to help players validate their understanding of the rules through a scenario. The turns below are not in order.

Note: This document has yet to be fully verified. Pending requests for clarifications have been added after the document at the bottom.

Scenario Setup

Location Battery Mines Damage