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
"""Solutions for 2024 Advent of Code puzzles. | |
https://adventofcode.com/2024 | |
""" | |
import argparse | |
from collections import Counter, defaultdict | |
from copy import deepcopy | |
from functools import cmp_to_key | |
from itertools import permutations, product | |
from math import gcd, log2, prod |
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
""" | |
Exports issues from a list of repositories to individual csv files. | |
Uses basic authentication (Github username + password) to retrieve issues | |
from a repository that username has access to. Supports Github API v3. | |
Forked from: unbracketed/export_repo_issues_to_csv.py | |
""" | |
import argparse | |
import csv | |
from getpass import getpass | |
import requests |
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
""" | |
When run in cron, automatically adds compliant alias names to local DNS. | |
Use at your own risk. | |
Patrick Fuller, 25 June 17 | |
""" | |
import re | |
import paramiko | |
import pymongo |
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
####################################################################### | |
# | |
# Cambridge Crystallographic Data Centre | |
# CCDC | |
# | |
####################################################################### | |
# | |
# If this CIF has been generated directly or indirectly from an entry in the | |
# Cambridge Structural Database, then it will include bibliographic, chemical, |
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
# pylint: disable=unspecified-encoding | |
"""Solutions for 2022 Advent of Code puzzles. | |
https://adventofcode.com/2022 | |
""" | |
import argparse | |
import functools | |
import itertools | |
import json | |
from queue import LifoQueue |
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
$('.dx').each((i, el) => { | |
let val = $(el).html(); | |
if (val.slice(-1) === '"') { | |
$(el).html((parseFloat(val.slice(0, -1)) * 25.4).toFixed(1) + ' mm'); | |
} | |
}); |
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 | |
# When SCSS is changed in a commit, this compiles and commits the affected css. | |
# This script assumes a project directory of the form: | |
# main.scss | |
# main.css | |
# scss | |
# | file_1.scss | |
# | ... | |
# | file_n.scss |
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 requests | |
import getpass | |
import sys | |
import json | |
import Queue | |
# This is a script, let's be lazy. We'll fill up this global and print it. | |
g = {"nodes": {}, "edges": []} | |
# And here's the cutoff criterion | |
MAX_NODES = 1000 |
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
""" | |
Create a custom grid-paper design as a minified vector image. | |
This uses a unique adaptation of "stroke-dasharray" to create the grid | |
pattern in a very small svg. | |
Usage: | |
python grid_maker.py > grid.svg | |
python grid_mater.py --help |
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
""" | |
A webserver to test Google OAuth in a couple of scenarios. | |
""" | |
import argparse | |
import time | |
import tornado.ioloop | |
import tornado.web | |
import tornado.auth | |
import tornado.gen |
NewerOlder