Skip to content

Instantly share code, notes, and snippets.

Paul Fawkesley paulfurley

Block or report user

Report or block paulfurley

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@paulfurley
paulfurley / gist:9488524
Created Mar 11, 2014
Backdrop logstash format
View gist:9488524
{
"@fields":{
"relativeCreated":344.9680805206299,
"process":12223,
"args":[
],
"module":"log_handler",
"funcName":"set_up_logging",
"message":"backdrop.read.api logging started",
@paulfurley
paulfurley / open_file.py
Last active Aug 29, 2015
Transparently open a file with open or gzip.open depending on file extension
View open_file.py
import gzip
import logging
from contextlib import contextmanager
@contextmanager
def open_file(filename, *args, **kwargs):
"""
Detect if a file is gzipped and use the appropriate open method.
View Alien Language solution.py
"""
Alien Language - solution
Google Code Jam 2009 - Qual round
Problem available at
http://code.google.com/codejam/contest/90101/dashboard#s=p0
By Tim Lee, 28/04/14
Input as L D N, followed by D dictionary words, N 'patterns' to decode
"""
@paulfurley
paulfurley / repos.json
Last active Aug 29, 2015
Fourth Wall Repos (Sea Level Research)
View repos.json
[
{
"userName": "sealevelresearch",
"repo": "sea-level-api"
},
{
"userName": "sealevelresearch",
"repo": "pilot-planner"
},
{
@paulfurley
paulfurley / ea-measurement-analysis
Created Aug 18, 2014
Analysing the EA Measurements website (ie http://apps.environment-agency.gov.uk/river-and-sea-levels/120705.aspx?stationId=5084) - multiple requests give different "latest" time & measurement
View ea-measurement-analysis
Mon Aug 18 12:47:01 BST 2014
datetime(2014, 8, 18, 11, 15, tzinfo=<UTC>), measurement=-2.14
datetime(2014, 8, 18, 11, 0, tzinfo=<UTC>), measurement=-2.14
datetime(2014, 8, 18, 11, 0, tzinfo=<UTC>), measurement=-2.14
datetime(2014, 8, 18, 11, 0, tzinfo=<UTC>), measurement=-2.14
datetime(2014, 8, 18, 11, 0, tzinfo=<UTC>), measurement=-2.14
datetime(2014, 8, 18, 11, 0, tzinfo=<UTC>), measurement=-2.14
datetime(2014, 8, 18, 11, 0, tzinfo=<UTC>), measurement=-2.14
datetime(2014, 8, 18, 11, 15, tzinfo=<UTC>), measurement=-2.14
datetime(2014, 8, 18, 11, 15, tzinfo=<UTC>), measurement=-2.14
@paulfurley
paulfurley / citybike.json
Created Sep 11, 2014
Liverpool Citybike unofficial API example
View citybike.json
{
"lastRefreshed": "2014-06-10T10:30:00Z",
"lastChanged": "2014-06-10T10:17:13Z",
"locations": [
{
"latitude": 53.4051319444,
"locationName": "Pier Head Ferry Terminal",
"availableBikes": 3,
"longitude": -2.9971558333,
"availableLocks": 7
@paulfurley
paulfurley / BAD_simples2k.json
Last active Aug 29, 2015
Json output of GPG file generated with `echo hello | gpg --s2k-mode=0` and passphrase `foo`. Incorrect decryption of ciphertext!
View BAD_simples2k.json
[
{
"header": {
"packet_type": "SymmetricKeyEncryptedSessionKeyPacket",
"packet_tag": 3,
"packet_format": "old",
"header_octets": {
"octets": "8c:04",
"length": 2
},
View keybase.md

Keybase proof

I hereby claim:

  • I am paulfurley on github.
  • I am paulfurley (https://keybase.io/paulfurley) on keybase.
  • I have a public key whose fingerprint is A999 B749 8D1A 8DC4 73E5 3C92 309F 635D AD1B 5517

To claim this, I am signing this object:

@paulfurley
paulfurley / gist:6596fe4166ef7b67ab8e
Created Nov 20, 2015 — forked from methane/gist:2185380
Tornado Example: Delegating an blocking task to a worker thread pool from an asynchronous request handler
View gist:6596fe4166ef7b67ab8e
from time import sleep
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.web import Application, asynchronous, RequestHandler
from multiprocessing.pool import ThreadPool
_workers = ThreadPool(10)
def run_background(func, callback, args=(), kwds={}):
def _callback(result):
View XeroxColorQube9303.ppd
*PPD-Adobe: "4.3"
*% Adobe Systems PostScript(R) Printer Description File
*% Copyright 2009 Xerox Corporation.
*% PPD File Info
*FileVersion: "5.371.0.0"
*FormatVersion: "4.3"
*LanguageEncoding: ISOLatin1
You can’t perform that action at this time.