This file contains hidden or 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
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)) |
This file contains hidden or 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/python | |
import datetime | |
import random | |
import requests | |
import sys | |
import uuid | |
from multiprocessing import Pool |
This file contains hidden or 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
((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: |
This file contains hidden or 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
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 |
This file contains hidden or 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 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) |
This file contains hidden or 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
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 |
This file contains hidden or 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
1. one | |
2. two | |
3. three | |
================================================================= | |
Heading | |
----------------------------------------------------------------- |
This file contains hidden or 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
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 |
This file contains hidden or 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
// 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 |
NewerOlder