Skip to content

Instantly share code, notes, and snippets.

View commuterjoy's full-sized avatar

Matt Chadburn commuterjoy

View GitHub Profile
@commuterjoy
commuterjoy / ft-todo.md
Last active August 29, 2015 14:03
ft todo

A few things on my to-do list.

1/ Implement cluster API - http://nodejs.org/api/cluster.html

Can we get a simple demo application working with cluster based deployments on ft platform?

Some notes here - https://gist.github.com/jedi4ever/6079180

Clustering seems useful for, a) using multiple processors on the same machine, b) not having to rely on doing a forever restarts when you deploy, c) no-downtime deploys, and possibly d) dynamic scaling.

@commuterjoy
commuterjoy / gist:5a59ad43213512ea3881
Created July 4, 2014 19:19
Merging a conflict automatically
git checkout master
git pull
git merge splunk
git checkout --ours version
git add version
git commit
@commuterjoy
commuterjoy / package.js
Last active August 29, 2015 14:01
Packaging a Express application
/*
Deploying an Express application involves packaging, a) dependent node
modules, read from 'package.json', b) and a list of arbitrary other
directories required at runtime.
Usage:
$ tar -cvzf source-0.1.0.tar.gz `node scripts/package.js`
Thread ID: 70172006540380
Fiber ID: 70172024069920
Total: 134.345112
Sort by: self_time
%self total self wait child calls name
2.74 25.741 3.675 0.000 22.066 4327726 *Class#new
2.39 8.812 3.208 0.000 5.604 1083514 Set#initialize
2.13 11.863 2.856 0.000 9.007 497319 Sass::BaseEnvironment#initialize
2.05 2.749 2.749 0.000 0.000 4013864 Kernel#is_a?
http://clamo.ftdata.co.uk/api?callback=clamoJSONP3&request=[{%22action%22:%22getPost%22,%22arguments%22:{%22id%22:%22147292%22,%22outputfields%22:{%22id%22:true,%22title%22:true,%22content%22:%22html%22,%22abstract%22:%22html%22,%22contentlength%22:true,%22abstractlength%22:true,%22datepublished%22:true,%22currentversion%22:true,%22tags%22:%22visibleonly%22,%22authorpseudonym%22:true,%22authoravatar%22:true,%22attachments%22:%22html%22,%22status%22:true,%22metadata%22:true,%22shorturl%22:true}}}]&icb=23317123
[email protected] /Users/matt.chadburn/Projects/article
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ └── [email protected]
@commuterjoy
commuterjoy / gist:10422381
Created April 10, 2014 20:54
Developer Manager technical interview
# Feature switch system
In the presentation tier of the website we want the ability to turn features on and off outside of release cycles.
I think we'll have around 150 switches.
Can you please outline a system that does that?
Please ask as many questions you need to clarify the requirements.
@commuterjoy
commuterjoy / gist:10315062
Created April 9, 2014 20:59
Generate the response code for a list of URLs (inc. following redirects)
cut -d , -f 2 list-of-urls | xargs -n 1 -I @ echo 'curl -Lsi -w "%{http_code} %{url_effective}\\n" @ -o /dev/null' | /bin/sh
# transfer locally cached resources to s3 (single threaded)
s3:
s3cmd put -m text/html --add-header 'Cache-Control: max-age=60' --acl-public --recursive target/cache/www.theguardian.com/books s3://aws-frontend-archive/www.theguardian.com/
@commuterjoy
commuterjoy / gist:9930768
Created April 2, 2014 09:23
r1 xml rss
rewrite ^/rss/0,,,00.xml /rss permanent;
rewrite ^/rss/1,,,00.xml /rss permanent;
rewrite ^/rssfeed/0,,1,00.xml /rss permanent;
rewrite ^/rssfeed/0,,10,00.xml /books/rss permanent;
rewrite ^/rssfeed/0,,11,00.xml /uk/rss permanent;
rewrite ^/rssfeed/0,,12,00.xml /world/rss permanent;
rewrite ^/rssfeed/0,,15,00.xml /theobserver/rss permanent;
rewrite ^/rssfeed/0,,16,00.xml /film/rss permanent;
rewrite ^/rssfeed/0,,18,00.xml /science/rss permanent;
rewrite ^/rssfeed/0,,19,00.xml /politics/rss permanent;