Skip to content

Instantly share code, notes, and snippets.

View quis's full-sized avatar

Chris Hill-Scott quis

View GitHub Profile
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)
@quis
quis / routes.js
Last active August 1, 2018 14:41
How to integrate the prototype kit with GOV.UK Notify
// Add this code to the top of routes.js
// process.env.NOTIFYAPIKEY is a special kind of variable that Node
// pulls from the environment your prototype is running in
//
// To set it locally, run this command in your Terminal, in the root
// folder of your prototype:
// echo NOTIFYAPIKEY=xxxxxxx >> .env
// (where xxxxxxx is a key you’ve created in Notify)
//
// To set it on Heroku, go to the settings page on your app, click