Skip to content

Instantly share code, notes, and snippets.

@robert-b-clarke
robert-b-clarke / .vimrc
Last active February 27, 2023 15:49
My (minimalist) vimrc
syntax on
filetype indent plugin on
set modeline
set tabstop=8
set expandtab
set softtabstop=4
set shiftwidth=4
filetype indent on
set number
colorscheme darkblue
@robert-b-clarke
robert-b-clarke / sns-botocore.py
Created June 27, 2014 13:36
Publish SNS messages in Python3 using botocore
import botocore.session
# establish a session and set credentials
sesh = botocore.session.get_session()
sesh.set_credentials(access_key='YOUR_KEY', secret_key='YOUR_SECRET')
#get SNS service and set endpoint
sns = sesh.get_service('sns')
endpoint = sns.get_endpoint('eu-west-1') #or another AWS region
@robert-b-clarke
robert-b-clarke / deploy_to_s3.py
Created January 27, 2014 10:51
A simple python script for copying static web resources to an S3 bucket and advance gzipping JS and CSS. Let me know if it's useful (and not already implemented by something else), I may make it into a proper repo
"""
===========
Description
===========
Simple script to copy and gzip static web files to an AWS S3 bucket. S3 is great for cheap hosting of static web content, but by default it does not gzip CSS and JavaScript, which results in much larger data transfer and longer load times for many applications
When using this script CSS and JavaScript files are gzipped in transition, and appropriate headers set as per the technique described here: http://www.jamiebegin.com/serving-compressed-gzipped-static-files-from-amazon-s3-or-cloudfront/
* Files overwrite old versions
@robert-b-clarke
robert-b-clarke / gist:7872713
Last active December 30, 2015 19:09
Being invited to try "Circle - The local network" didn't just make me angry, it made me think about a lot other stuff.

It's been 3 months since I launched the proof of concept for LampNote, my platform for sharing and discovering local information. During that time it's become apparent that in its present form the site is unlikely to achieve the kind of exponential growth that will result in it becoming “the next big thing”, though it has achieved some modest success reuniting missing cats with their owners.

Since LampNote went live I've come across several sites and mobile apps which endeavour to accomplish something similar. That doesn't usually bother me. “Tell my neighbours about X” and “what's happening at Y” are still problems that haven't really been solved using the internet. It's no surprise that other people are trying their own approach with varying degrees of funding, traction and quality. Something odd happened yesterday though. I was invited via a Facebook notification to join Circle “the local network”. As I researched Circle I was simultaneously appalled and amazed, for this was a prod

@robert-b-clarke
robert-b-clarke / gtfs-splitter.pl
Last active December 9, 2020 21:10
Split a large gtfs filon e into separate ones for each agency - tested on http://www.datagm.org.uk/package/public-transport-schedules--gtfs
=head1 NAME
gtfs-splitter.pl
=head1 DESCRIPTION
Hastily assembled and extremely unguaranteed perl script for dividing gtfs files into smaller per agency files
=head1 SYNOPSIS
@robert-b-clarke
robert-b-clarke / run-qunit-tap.js
Created January 30, 2013 17:45
Adaptation of example run-qunit.js, provided with PhantomJS distribution. Run QUnit test and produce TAP output
/**
run-qunit-tap.js
Run QUnit tests using PhantomJS and produce TAP output
Quick and dirty adaptation of example run-qunit.js, provided with PhantomJS
distribution.
All console output, apart from TAP plan and test results, is formatted as a
TAP comment
@robert-b-clarke
robert-b-clarke / men.md
Last active December 11, 2015 09:39
Why the new MEN website risks upsetting users

My thoughts on the the forthcoming relaunch of the Manchester Evening News website

In the internet business you get used to seeing the work you’ve done slowly disappearing from public view. After well over ten years building websites and associated systems it’s something that rarely bothers me. However, this week’s announcement by the Manchester Evening News that they are relaunching their website did raise my hackles somewhat, but not because they’re discontinuing the last remnants of systems I helped to design and build.

I worked at the MEN from 2005 through to 2010. In late 2006 it was decided that we would relaunch the Manchester Evening News website. Usability consultants were hired, and managed to persuade everyone that the site should carry less adverts, some fancy new search technology was purchased, and everyone got together and focused on making the site better. On the dev team we got ch