Skip to content

Instantly share code, notes, and snippets.

View jcleveley-zz's full-sized avatar

John Cleveley jcleveley-zz

  • BuzzFeed
  • London
View GitHub Profile
@jcleveley-zz
jcleveley-zz / gist:3665616
Created September 7, 2012 12:03
Test vary
curl -s -I -H 'X-Transclude: 1' -H 'Cookie: BBC-UID=' http://m.int.bbc.co.uk/news | egrep '(Id|Vary)' && curl -s -I -H 'Cookie: BBC-UID=' http://m.int.bbc.co.uk/news | egrep '(Id|Vary)'
@jcleveley-zz
jcleveley-zz / gist:3774953
Created September 24, 2012 08:39
Horizontal page swipe
// From http://www.cforcoding.com/2009/07/plain-english-explanation-of-big-o.html
// Use mobile User-Agent
var e = !1, f = window, g = Function, h = document, i = Math, j = Array, k = "appendChild", l = "length", n = "prototype", p = "slice", q = "indexOf", r = "call", t = "createElement", u = "addEventListener", w = "apply", x = "bind", y = "", z = " ", A = "div", aa = "native code", ba = "navigating", B = "prerender", ca = "px", da = "px, 0, 0)", ea = "string", C = "swiping", fa = "touchend", ga = "touchmove", ha = "touchstart", ia = "translate3d(";
function D(a) {
return typeof a == ea
}
i.floor(2147483648 * i.random()).toString(36);
function ja(a, c, b) {
return a[r][w](a[x], arguments)
@jcleveley-zz
jcleveley-zz / gist:4067576
Last active December 11, 2015 10:45
Technical test

Summary

Write a simple JavaScript application that given a number of pennies will calculate the minimum number of Sterling coins needed to make that amount.

Eg. 123p = 1 x £1, 1 x 20p, 1 x 2p, 1 x 1p

You should be prepared to spend at least two hours on it.

Requirements

tabloid/webapp/static/conf/tabloid.sandbox
# Stop phantomjs blowing up by 403ing on ttf fonts
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} cucumber [NC]
RewriteRule ^.*\.ttf$ - [F,L]
➜ workspace git:(desktop-weather) ✗ curl -I http://static.sandbox.dev.bbc.co.uk/news/dev/fonts/gel-news-icons-v3/gelnewsicons-regular-webfont.ttf
HTTP/1.1 200 OK
@jcleveley-zz
jcleveley-zz / gist:4135842
Created November 23, 2012 14:21
For each MP3 file, set the filename as the song title
#!/bin/bash
# Description: For each MP3 file, set the filename as the song title
for i in *.mp3; do
SONG="$i"
id3v2 --song "$SONG" --artist "Quartershade" --album "Quartershade" "$i"
done
@jcleveley-zz
jcleveley-zz / gist:4233525
Created December 7, 2012 14:19 — forked from commuterjoy/gist:1391581
Grade 8 Job Requirements - Senior Web Developer

Essential

Software craft

  • Experience of Test Driven Development and automated Acceptance Tests with Cucumber.
  • Ability to write good quality OO code including patterns and refactoring.
  • Healthy interest in upcoming web standards and technology.

Performance

Top 100 PHP libraries from packagist

  1. twig/twig - Twig, the flexible, fast, and secure template language for PHP - 279287
  2. symfony/symfony - The Symfony PHP framework - 230662
  3. doctrine/common - Common Library for Doctrine projects - 230352
  4. doctrine/dbal - Database Abstraction Layer - 217097
  5. monolog/monolog - Logging for PHP 5.3 - 197983
  6. doctrine/orm - Object-Relational-Mapper for PHP - 196816
  7. swiftmailer/swiftmailer - Swiftmailer, free feature-rich PHP mailer - 172086
  8. kriswallsmith/assetic - Asset Management for PHP - 165852
  9. [sensio/distribution-bundle](https://packagist.org/packages/sen
@jcleveley-zz
jcleveley-zz / bio.md
Last active December 12, 2015 03:28
Bio for conferences etc

John is Tech Lead at BBC News and currently migrating the News site to a dynamic platform. Concentrating on building features mobile first using responsive web design all the way up to desktop.

BBC News has a truly global audience, delivering some of the only unbiased journalism available in some parts of the world. This has reinforced his passion for device support and producing sites that absolutely fly.

Loves canoeing, ale and Radiohead - preferably all at the same time :) Find me here @jcleveley

@jcleveley-zz
jcleveley-zz / dev_tools_osx.md
Last active December 12, 2015 10:39
Dev setup for osx

Performance Hack - December 2013

Legacy of the hack

  • The majority of the hacks will be be made a reality
  • Pretty bad performance bug was found and fixed!
  • The Rashboard hack will help developer teams understand the real-time performance of the site
  • Everyone was excited about the potential of RUM data after James's talk
  • N&K data developers joined in and were keen to develop ideas useful to News
  • Great to see the unsurmountable stairs between floor 3/4 start to break down as everyone worked and chatted in the same space for 2 days