Skip to content

Instantly share code, notes, and snippets.

View commuterjoy's full-sized avatar

Matt Chadburn commuterjoy

View GitHub Profile
@commuterjoy
commuterjoy / gist:d00980e061dc5df35b89
Created May 27, 2015 09:00
spoor api message format
{
"envelope": {
"headers": {
"user-agent": "curl/7.30.0",
"host": "localhost:5101",
"accept": "*/*",
"content-length": "27",
"content-type": "application/x-www-form-urlencoded"
},
"url": {
@commuterjoy
commuterjoy / manifesto.md
Created April 23, 2015 21:27
Manifesto mentions internet, broadband, web, engineering, digital

Tory

roll out universal broadband and better mobile phone connections, to ensure everyone is part of the digital economy.

This will fund the biggest investment in rail since Victorian times, and the most extensive improvements to our roads since the 1970s. And it will give us the most comprehensive and cheapest superfast broadband coverage of any major European country

@commuterjoy
commuterjoy / gist:f7891ff8a8bc3da15c80
Created April 16, 2015 15:13
next check in pingdom
curl -i \
-X PUT \
-d 'name=ft-next-session-service&host=ft-next-session-service.herokuapp.com&url=%2F__gtg&resolution=1&contactids=10929982&tags=bronze' \
-u 'email:password' \
-H 'Account-Email: ftpingdom@ft.com' \
-H 'App-Key: pingdom-api-key' \
https://api.pingdom.com/api/2.0/checks/1571037

Filter a for arrays that do not contain the number '3'

var a = [
   [1, 2, 3],
   [3, 2, 4],
   [1, 2, 1]
]
{
"meta": {},
"user": {
"version": "1",
"erights": "1111530",
"isStaff": true,
"flags": [],
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36",
"deviceType": [
"phone",
@commuterjoy
commuterjoy / gist:dd006870480a62549abc
Created March 5, 2015 16:12
list of article summaries
# export apikey=`cat ~/.ftapi`; node summary.js
var client = require('ft-api-client')(process.env.apikey, { pollForPages: false });
client.get([
'03b49444-16c9-11e3-bced-00144feabdc0',
'7d9ee96e-3a70-11e4-bd08-00144feabdc0',
'a7008958-f2f3-11e3-a3f8-00144feabdc0'
]).then(function (articles) {
articles.forEach(function (article) {
@commuterjoy
commuterjoy / gist:f64f57d8a866bf37fdbc
Last active August 29, 2015 14:16
ijento embed on next
<script>
(function () {
if (!location.pathname) {
return;
}
var js = '<script src="/__ijento/' + location.pathname.slice(1) + '"></script>';
document.write(js);
})();
</script>
@commuterjoy
commuterjoy / gist:5447acda7a60b1faaff9
Created February 24, 2015 13:57
generate a list of headlines for jess
[].slice.call(document.querySelectorAll('[data-trackable="top-stories-stream"] a[data-trackable="headline"]')).map(function (a) { return a.href })
(function () {
var soak = function () {
// a list of URLs to test
var urls = [
'http://next.ft.com/uk' // TOOD - mappings between ft & next
];
urls.forEach(function (url) { console.log(url);
var v = new VideoPlayer( { preroll: true } );
v.play('http://brightcove.vo.llnwd.net/v1/uds/pd/47628783001/201410/897/47628783001_3817208988001_Wonga-021014.mp4');