Skip to content

Instantly share code, notes, and snippets.

View quis's full-sized avatar

Chris Hill-Scott quis

View GitHub Profile
@quis
quis / poc.py
Created October 16, 2025 19:13
Proof of concept for user sorting bug
class User():
def __lt__(self, other):
return False
def __eq__(self, other):
return self.foo == other.foo
# Replicates https://github.com/pallets/jinja/blob/5ef70112a1ff19c05324ff889dd30405b1002044/src/jinja2/filters.py#L435-L437
def key_func(user):
class MinimalModel():
@property
@abstractmethod
def properties(self):
pass
def __init__(self, database_object):
for property in self.properties:
setattr(self, property getattr(database_object, property))
#!/usr/bin/python
import datetime
import random
import requests
import sys
import uuid
from multiprocessing import Pool
((user_name)) has invited you to collaborate on ((organisation_name)) on GOV.UK Notify
***
((user_name)) has invited you to collaborate on ((organisation_name)) on GOV.UK Notify.
GOV.UK Notify makes it easy to keep people updated by helping you send text messages, emails and letters.
Create your GOV.​UK Notify account at:
preview=$(curl -s https://www.notify.works/_status | jq '.travis_commit')
staging=$(curl -s https://www.staging-notify.works/_status | jq '.travis_commit')
production=$(curl -s https://www.notifications.service.gov.uk/_status | jq '.travis_commit')
echo "Preview: ${preview}"
echo "Staging: ${staging}"
echo "Production: ${production}"
if [ $preview = $production ]
then
import re
import requests
from bs4 import BeautifulSoup
from collections import OrderedDict
from itertools import chain
from io import BytesIO
from tika import parser
from joblib import Memory
location = './cachedir'
memory = Memory(location, verbose=0)
@quis
quis / Biggest teams.sql
Last active November 25, 2021 11:35
Useful Notify reports
select
count(*),
services.name,
'https://www.notifications.service.gov.uk/services/' || services.id
from
user_to_service
join
services on service_id = services.id
group by
services.name, services.id
@quis
quis / example.txt
Last active April 6, 2018 15:27
GOV.UK Notify plain text email changes
1. one
2. two
3. three
=================================================================
Heading
-----------------------------------------------------------------
@quis
quis / domains.txt
Last active November 21, 2017 09:20
Domains of public sector organisations not on gov.uk
acas.org.uk
ahdb.org.uk
ahrc.ac.uk
arb.org.uk
artscouncil.org.uk
bankofengland.co.uk
bbc.co.uk
bbsrc.ac.uk
bfi.org.uk
biglotteryfund.org.uk
@quis
quis / footer.html
Created May 4, 2017 11:57
Notify email template (plain HTML, GOV.UK branding only)