Skip to content

Instantly share code, notes, and snippets.

Matt Chadburn commuterjoy

View GitHub Profile
@commuterjoy
commuterjoy / foo.sh
Created Mar 20, 2017
Rollback git commits and generate code stats
View foo.sh
git log | egrep "^commit" | cut -d ' ' -f 2 | xargs -I % echo "git reset --hard % && cloc ." | /bin/sh
View gifting.json
{
"system": {
"api_key": "qUb9maKfKbtpRsdp0p2J7uWxRPGJEP",
"version": "1.1.15",
"source": "o-tracking"
},
"context": {
"id": "ciwg346a6000s3g5pp2is5ia5",
"root_id": "ciwg2v2lv00013g5p9rm9qlfv",
"product": "next",
View salesforce.js
var SalesForce = (function () {
// private
var connection = { foo: 'bar' }; // create the connection here
// public
return {
// expose the connection object
connection: connection,
@commuterjoy
commuterjoy / see-cert.js
Created Oct 13, 2016
View a website's SSL certificate
View see-cert.js
/*
* Usage:
*
* node see-cert https://www.ft.com
*
*/
const url = require('url');
const https = require('https');
@commuterjoy
commuterjoy / urls.md
Last active Oct 5, 2016
ft.com URL tidy up
View urls.md
View slideshow.html
<script>
// 1.gif, 2.gif, 3.gif etc.
setInterval(() => {
document.body.style.backgroundImage = "url(" + (parseInt(Math.random() * 60) + 1) + ".gif)";
}, 2000);
</script>
<style>
body {
background-size: 100% 100%;
}
View url.json
{
"url": {
"protocol": "http:",
"slashes": true,
"auth": null,
"host": "markets.ft.com",
"port": null,
"hostname": "markets.ft.com",
"hash": null,
"search": "?s=FFBL:KAR&currency=GBP",
View o-tracking.json
{
"system": {
"api_key": "qUb9maKfKbtpRsdp0p2J7uWxRPGJEP",
"version": "1.1.8",
"source": "o-tracking"
},
"context": {
"id": "ciniqsc9q00013i5mjzkomzph",
"root_id": "ciniqsc9o00003i5m8bhqi7sk",
"product": "next",
@commuterjoy
commuterjoy / idea-1.md
Last active Apr 11, 2016
Testing Zuora in production
View idea-1.md
  1. Make up a simple proxy server (see below).
  2. We give that a DNS entry Eg, next-signup-test-suite.ft.com
  3. Create a single Zuora configuaration, valid for that host.
  4. The proxy server forms a URL from a ft-heroku-backend header sent by each test suite + path of the original request and proxies that request to the temporary Heroku backend.
  5. As long as the proxy server does not cache any requests we should be able to spin up as many concurrent branches as we need.
var https			= require('https');
var app				= require('express');
View new format.xml
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title>
<![CDATA[World]]>
</title>
<description>
<![CDATA[World]]>
</description>
<link>http://next.ft.com/stream/sectionsId/MQ==-U2VjdGlvbnM=.rss</link>
You can’t perform that action at this time.