Skip to content

Instantly share code, notes, and snippets.

View commuterjoy's full-sized avatar

Matt Chadburn commuterjoy

View GitHub Profile
@commuterjoy
commuterjoy / gist:37b99f9ecd8c93bb0bab
Created September 15, 2015 20:27
extract the first and last characters of a string
"apple"
.split("")
.filter(function(a, b, c) { return b === 0 || b === c.length-1 })
.join(" ")
{
"time": {
"day": "2015-07-16T00:00:00Z",
"hour": "2015-07-16T09:00:00Z",
"now": "2015-07-16T09:23:56.906Z",
"dayOfWeek": 4,
"dayInWords": "Thursday",
"dayOfYear": 197,
"date": 16,
"month": 7,
{
"annotations": {
"time": {
iso: {
"day": "2015-07-15T00:00:00Z",
"hour": "2015-07-15T18:00:00Z",
"now": "2015-07-15T18:17:30.927Z",
},
"dayOfWeek": "3",
"dayInWords": "Wednesday",
{
"context": {
"product": "next",
"requestedSendTime": "1436245212",
"geoIp": {
"latitude": 37.4536,
"city": "Incheon",
"region": "12",
"longitude": 126.7317,
"country": "KR"
@commuterjoy
commuterjoy / gist:24568be66d7cf9d9e902
Last active August 29, 2015 14:24
next tweeters in last 7 days
1,@BJ_Southerner,265
1,@BizDeansTalk,745
3,@Bruce_Palling,6000
1,@CAlvareng,131
1,@Christoph_Rocks,73
2,@ELENAYEPESEV,290
1,@EmilyJG,2500
1,@FractalEcho,290
1,@G65,463
2,@GentleThinker,663
@commuterjoy
commuterjoy / gist:fd7137307b50df6113d3
Last active August 29, 2015 14:23
weekly deploys to production on next.ft.com
14 2015/06/22 - Monday
31 2015/06/23
40 2015/06/24
37 2015/06/25
44 2015/06/26
2 2015/06/27
1 2015/06/28 - Sunday
---
169
@commuterjoy
commuterjoy / 404.md
Created June 5, 2015 15:29
applications without service registry entries
404 http://localhost:5000/find?by=http://ft-next-assets.herokuapp.com&filter=nodes
404 http://localhost:5000/find?by=http://ft-next-beacon.herokuapp.com&filter=nodes
404 http://localhost:5000/find?by=http://ft-next-community-read-api.herokuapp.com&filter=nodes
404 http://localhost:5000/find?by=http://ft-next-config-vars.herokuapp.com&filter=nodes
404 http://localhost:5000/find?by=http://ft-next-engels.herokuapp.com&filter=nodes
404 http://localhost:5000/find?by=http://ft-next-fastly-to-graphite.herokuapp.com&filter=nodes
404 http://localhost:5000/find?by=http://ft-next-gate.herokuapp.com&filter=nodes
404 http://localhost:5000/find?by=http://ft-next-graphite-dashboard.herokuapp.com&filter=nodes
404 http://localhost:5000/find?by=http://ft-next-grumman-v002.herokuapp.com&filter=nodes
@commuterjoy
commuterjoy / README.md
Last active August 29, 2015 14:22
Spoor models

Thems the rules

  • event.source is mandatory, everything else is optional.
  • if user.session.token is included it will be validated against the session api and expanded in to a membership uuid.
  • if content.uuid is included it will be expanded in to a set of content api meta-data.
  • ...
@commuterjoy
commuterjoy / egest.json
Created June 2, 2015 16:31
spoor egest json format
{
"MessageId": "4a44742d-34ac-4e4e-bb55-1fa3a68b37fd",
"ReceiptHandle": "AQEBcNh9bafIiuA54bBJt/BD5asAN996nmXoVWlDynWhJuA/rqa7oN+4DVx3lhKdLnqboLq+W2z2dJWGhYK+q+co1aMNGmKcHK9Lwcm4yydGQBaMFQlNNU53aaiBn9JQSLaY4l+j1DJQIyGHd1J3Cp0P51qPkTCZmUELcIBiEp1cXvolzfIDxEs4I6ZqU0V4Li8sKsEX157Z76miRc+r/4yse+3ZYbv1poCsCVmwybqwLfMyaS3EQ/hRLwfH7Yt6GUbny+B30lrSSe6PmcWSiyEFmvccxgEzWVqCQTAN1NCzJ/6dmRPVF8ldnclDEc9+D7AbNKi06khmIEIqtKREQwvHHQ==",
"MD5OfBody": "c5303c59f3ed0daf535e92ccf2c1de5d",
"Body": "{\\"envelope\\":{\\"headers\\":{\\"host\\":\\"spoor-api.ft.com\\",\\"connection\\":\\"close\\",\\"accept\\":\\"image/webp,*/*;q=0.8\\",\\"user-agent\\":\\"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36\\",\\"referer\\":\\"http://www.ft.com/life-arts/theatre-dance\\",\\"accept-language\\":\\"en-US,en;q=0.8\\",\\"cookie\\":\\"mm_t9_clean=18072014; SIVISITOR=MS45OTMuNTMxOTk4OTQ1NDAwMS4xNDE0NDI2Nzc0MTY1Li04ZTY4MWI2*; FTUserTrack=81.133.44.71.1414426774313577; cook
fetch('http://spoor-api.ft.com/px.gif', {
method: 'post',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
timeout: 5000,
headers: {
'content-length': Buffer.byteLength(JSON.stringify(event), 'utf8')
},