Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import base64
import os
import sys
import webbrowser
import hashlib
import hmac
{
"NiaGriffithMP": 481120639,
"StewartHosieMP": 219298196,
"MichaelMcCannMP": 397229449,
"GWilliamsonMP": 368314502,
"JohnHowellMP": 993161678,
"tomgreatrexmp": 198912426,
"PatGlassMP": 118429508,
"NickBolesMP": 1548391070,
"jarrowstevemp": 2808847414,

Keybase proof

I hereby claim:

  • I am andylolz on github.
  • I am andylolz (https://keybase.io/andylolz) on keybase.
  • I have a public key whose fingerprint is 8B21 BF74 E3E1 21AB 4D5D A33B 43A3 BB6E 4CB8 8509

To claim this, I am signing this object:

@andylolz
andylolz / gist:976690ee36f081b1f504
Created April 10, 2015 09:39
Have submitted CVs
1930-06-21 Gerald Kaufman
1933-06-26 David Winnick
1943-08-20 Roger Gale
1944-09-08 Margaret Hodge
1945-11-14 Louise Ellman
1952-02-01 Andrew Smith
1952-03-22 David Jones
1952-04-04 Jim Fitzpatrick
1953-01-11 Graham Allen
1953-07-24 Julian Brazier
@andylolz
andylolz / fetch_all.py
Created October 1, 2012 15:56
Useful useful useful
def fetch_all(model_or_query):
'''Fetch all the entities of the given model, or satisfying the given query.
'''
if isinstance(model_or_query, type) and issubclass(model_or_query, db.Model):
query = model_or_query.all(keys_only=False)
elif isinstance(model_or_query, db.Query):
query = model_or_query
else:
raise Exception("model_or_query is neither a model nor a query")
@andylolz
andylolz / gist:3860781
Created October 9, 2012 19:11
Block out a load of IDs
from google.appengine.ext import db
import sys
import inspect
def fetch_all(model_or_query):
'''Fetch all the entities of the given model, or satisfying the given query.
'''
if isinstance(model_or_query, type) and issubclass(model_or_query, db.Model):
query = model_or_query.all(keys_only=False)
elif isinstance(model_or_query, db.Query):
@andylolz
andylolz / gist:3861722
Created October 9, 2012 22:03
Hammer the datastore
def hammer_the_datastore():
demo = models.School.all().filter('url_slug', 'demonstration').fetch(1)[0]
donations = []
print("Generating donations . . .")
for x in range(0, 500):
donations.append(models.Donation(
school=demo,
num_cells=10,
preferred_cell_index=-1,
donor_first_name="Andy",
@andylolz
andylolz / Artisan patch
Created October 14, 2012 16:14
Make key:generate work with the --env switch
diff --git a/laravel/cli/tasks/key.php b/laravel/cli/tasks/key.php
index 0c08a84..b7b5d00 100644
--- a/laravel/cli/tasks/key.php
+++ b/laravel/cli/tasks/key.php
@@ -19,7 +19,14 @@ class Key extends Task {
*/
public function __construct()
{
- $this->path = path('app').'config/application'.EXT;
+ if($environment = get_cli_option('env'))
@andylolz
andylolz / _typesetter.php
Created November 28, 2012 23:44
Typeset some content for a textbox; truncate it to fit.
<?php
/**
* Preliminary work on the typesetter.
*
* $input_str - the input
* $width - the width of the text area in characters
* $height - the height of the text area in characters
* $overflow_str - the string appended to the text area, in the event of an overflow
*
* returns the typeset contents of the text area
@andylolz
andylolz / 2016_numbers.md
Last active December 3, 2015 14:56
How many candidates are standing in UK elections in 2016?

2016 Elections – Candidate lists

One Democracy Club (DC) plan for 2016 is to create candidate lists for all 2016 UK elections (much like we did for the 2015 general election (GE2015) with https://yournextmp.com). Last night @ Citizen Beta (Cß), Mark Longair rightly flagged that this is quite (very) ambitious! I realised I have no handle on just how ambitious i.e. how many candidates we’re talking.

The Electoral Commission have a list of upcoming elections: http://www.electoralcommission.org.uk/find-information-by-subject/elections-and-referendums/upcoming-elections-and-referendums

Below are the numbers I’ve found so far for each.

Northern Ireland Assembly election