Skip to content

Instantly share code, notes, and snippets.

@abersager
abersager / index.html
Created March 29, 2012 22:36
Using cookies and nginx web server configuration to conditionally serve high resolution images
<!doctype html>
<!--
Using cookies and nginx web server configuration to conditionally serve
high resolution images to <img> tags
-->
<html>
<head>
<!-- set device-pixel-ratio cookie using JavaScript -->
<script type="text/javascript" charset="utf-8">
@abersager
abersager / Gemfile
Created June 6, 2013 16:28
Rails project setup for running Cucumber tests through Selenium and Sauce Labs
group :test, :development do
gem 'cucumber-rails'
gem "sauce-cucumber"
gem 'parallel_tests'
gem 'sauce-connect'
end
[
{
"userName": "alphagov",
"repo": "datainsight-frontend"
},
{
"userName": "alphagov",
"repo": "fourth-wall"
},
{
#!/bin/bash
# Setup and start Sauce Connect for your TravisCI build
# This script requires your .travis.yml to include the following two private env variables:
# SAUCE_USERNAME
# SAUCE_ACCESS_KEY
# Follow the steps at https://saucelabs.com/opensource/travis to set that up.
#
# Curl and run this script as part of your .travis.yml before_script section:
# before_script:
[
{
"userName": "abersager",
"repo": "fourthwalldemo"
},
{
"userName": "alphagov",
"repo": "signonotron2"
}
]
@abersager
abersager / gist:d2a0f925b11e0da92a86
Created August 19, 2014 07:24
Negative regex match
^((?!term).)*$

or

^((?!term).*)$
@abersager
abersager / gist:0d534eaacaef4eb5a0ad
Last active August 29, 2015 14:06
responsive-graphs
https://www.gov.uk/performance/prison-visits/volumetrics
http://rwillustrator.blogspot.ch/2007/04/understanding-9-slice-scaling.html
function stage1 () {
$('figure figcaption').hide();
$('.graph-wrapper').hide();
$('.graph').append($($('noscript').text()));
$('.graph img').css('width', '100%');
}