Skip to content

Instantly share code, notes, and snippets.

Avatar

Harry Biddle harrybiddle

  • Stockholm Environment Institute
  • Stockholm
View GitHub Profile
@harrybiddle
harrybiddle / test.yml
Created Sep 5, 2020
Skip GitHub Actions for Draft PRs
View test.yml
on:
pull_request:
types: [synchronize, opened, reopened, ready_for_review]
jobs:
build:
if: github.event.pull_request.draft == false
@harrybiddle
harrybiddle / iterables_equal.py
Last active Dec 17, 2019
Equality of nested iterables
View iterables_equal.py
from collections import Counter
def iterables_equal(a, b):
"""
Returns true if and only if two iterables of hashable objects are equal up to their
order. Iterables can be nested.
For example:
iterable_equality([1, 2], [2, 1]) # True
@harrybiddle
harrybiddle / timediff.py
Last active Oct 12, 2017
Simple Python script for computing differences between times
View timediff.py
#! /usr/bin/env python3
import argparse
import sys
from dateutil import parser as date_parser
from datetime import datetime
INTERVALS = (('years', 60 * 60 * 24 * 7 * 52),
('weeks', 60 * 60 * 24 * 7),
You can’t perform that action at this time.