Skip to content

Instantly share code, notes, and snippets.

View commuterjoy's full-sized avatar

Matt Chadburn commuterjoy

View GitHub Profile
@commuterjoy
commuterjoy / foo.sh
Created March 20, 2017 13:20
Rollback git commits and generate code stats
git log | egrep "^commit" | cut -d ' ' -f 2 | xargs -I % echo "git reset --hard % && cloc ." | /bin/sh
{
"system": {
"api_key": "qUb9maKfKbtpRsdp0p2J7uWxRPGJEP",
"version": "1.1.15",
"source": "o-tracking"
},
"context": {
"id": "ciwg346a6000s3g5pp2is5ia5",
"root_id": "ciwg2v2lv00013g5p9rm9qlfv",
"product": "next",
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 October 13, 2016 21:17
View a website's SSL certificate
/*
* Usage:
*
* node see-cert https://www.ft.com
*
*/
const url = require('url');
const https = require('https');
@commuterjoy
commuterjoy / urls.md
Last active October 5, 2016 21:30
ft.com URL tidy up
@commuterjoy
commuterjoy / slideshow.html
Created September 29, 2016 22:56
Simple slideshow
<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%;
}
{
"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",
{
"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 April 11, 2016 12:25
Testing Zuora in production
  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');
<?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>