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
<script> | |
var dnt = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack; | |
if (dnt != "1" && dnt != "yes") { | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
ga('create', 'UA-XXXXXXXX-X', 'auto'); | |
ga('send', 'pageview'); |
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
§ mkvirtualenv philtest | |
New python executable in /Users/matthew/.virtualenvs/philtest/bin/python | |
Installing setuptools, pip, wheel...done. | |
virtualenvwrapper.user_scripts creating /Users/matthew/.virtualenvs/philtest/bin/predeactivate | |
virtualenvwrapper.user_scripts creating /Users/matthew/.virtualenvs/philtest/bin/postdeactivate | |
virtualenvwrapper.user_scripts creating /Users/matthew/.virtualenvs/philtest/bin/preactivate | |
virtualenvwrapper.user_scripts creating /Users/matthew/.virtualenvs/philtest/bin/postactivate | |
virtualenvwrapper.user_scripts creating /Users/matthew/.virtualenvs/philtest/bin/get_env_details | |
(philtest) § pip install watchdog libsass | |
Collecting watchdog |
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
<?php | |
$secret = '...'; | |
$token = '...'; | |
$payload = $_POST['payload']; | |
$signature_header = $_SERVER['HTTP_X_HUB_SIGNATURE']; | |
$signature_calc = 'sha1=' . hash_hmac('sha1', 'payload=' . urlencode($payload), $secret, false); | |
if (!hash_equals($signature_header, $signature_calc)) { | |
exit("Signature did not match"); |
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
TheyWorkForYou person ID | beta.parliament person ID | beta.parliament photo ID | |
---|---|---|---|
24769 | http://id.ukpds.org/2PbBvbwn | http://id.ukpds.org/cu8BXNWP | |
24934 | http://id.ukpds.org/6jaB1p3Z | ||
24825 | http://id.ukpds.org/Ck8wwcfN | http://id.ukpds.org/8IaGHQzb | |
11626 | http://id.ukpds.org/eieTmLXh | http://id.ukpds.org/cs77uhlV | |
25304 | http://id.ukpds.org/gE4aCnm0 | ||
10084 | http://id.ukpds.org/jV72kIxb | http://id.ukpds.org/yBBERkOB | |
10383 | http://id.ukpds.org/dVovQSbU | ||
11943 | http://id.ukpds.org/tJDr7qN7 | ||
25654 | http://id.ukpds.org/DJ4HErt4 | http://id.ukpds.org/QfjSFljl |
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
gss | govuk_slug | homepage_url | |
---|---|---|---|
S12000033 | aberdeen | http://www.aberdeencity.gov.uk/ | |
S12000034 | aberdeenshire | http://www.aberdeenshire.gov.uk/ | |
E07000223 | adur | http://www.adur-worthing.gov.uk/ | |
E07000026 | allerdale | http://www.allerdale.gov.uk | |
E07000032 | amber-valley | http://www.ambervalley.gov.uk/ | |
S12000041 | angus | http://www.angus.gov.uk | |
N09000001 | antrim-newtownabbey | http://www.antrimandnewtownabbey.gov.uk | |
N09000011 | ards-and-north-down | http://www.ardsandnorthdown.gov.uk | |
S12000035 | argyll-and-bute | http://www.argyll-bute.gov.uk |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#!/usr/bin/env python | |
import os | |
import re | |
import requests | |
s = requests.Session() | |
class ThreeWebsite(object): | |
username = os.environ['PHONE_NUMBER'] |
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 re | |
import socket | |
import signal | |
import sys | |
import threading | |
def sigint_received(signum, frame): | |
sys.exit(0) | |
signal.signal(signal.SIGINT, sigint_received) |
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
PID = 'b04drklx' | |
for date in arrow.Arrow.range('day', arrow.now(), arrow.now().replace(weeks=1)): | |
soup = BeautifulSoup(get_contents('http://www.bbc.co.uk/cbeebies/programmes/schedules/%s' % date.format('YYYY/MM/DD'))) | |
for series in soup.findAll('span', resource=re.compile(PID)): | |
root = series.findParents(typeof="BroadcastEvent")[0] | |
season = root.find(typeof='TVSeason') | |
start_time = root.find(property='startDate')['content'] | |
title = season.nextSibling.string | |
series_num = season.find(property='name').string | |
episode_num = root.find('abbr').find(property='position').string |
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 argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument('args', nargs='*') # from __init__.py execute() | |
parser.add_argument('args', nargs='+') # from base.py LabelCommand add_arguments | |
print parser.parse_args(['foo1', 'foo2', 'foo3', 'foo4']) | |
# Outputs Namespace(args=['foo4']) |