This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import memcache | |
from hashlib import sha1 | |
from datetime import datetime | |
cache = memcache.Client(["127.0.0.1:11211"]) | |
class ActionThrottled(Exception): | |
pass | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#$ 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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from getpass import getpass | |
import argparse | |
import base64 | |
import hashlib | |
import json | |
import logging | |
import os | |
import secrets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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%)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#dig start(34;40; ) - - DwarfMockup(95;89;4;1) | |
~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,# | |
~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~,~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