Skip to content

Instantly share code, notes, and snippets.

View alexbilbie's full-sized avatar
👋

Alex Bilbie alexbilbie

👋
View GitHub Profile
<?php
namespace OAuth;
class AccessToken
{
/**
* @var string
*/
protected $type = 'Bearer';
@alexbilbie
alexbilbie / install.sh
Created April 18, 2015 21:27
Jenkins install
# Add the Jenkins source
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
echo 'deb http://pkg.jenkins-ci.org/debian binary/' >> /etc/apt/sources.list
# We're going to install Nginx too
echo "deb http://ppa.launchpad.net/nginx/stable/ubuntu trusty main" >> /etc/apt/sources.list.d/nginx-stable-trusty.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C
# Finally we want PHP too
echo "deb http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu trusty main" >> /etc/apt/sources.list.d/php5-5.6-trusty.list`
@alexbilbie
alexbilbie / gist:823a7987256556fecfb5
Last active August 29, 2015 14:12
Example StackPHP middleware
<?php
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class EtagMiddleware implements HttpKernelInterface
{
protected $app;
@alexbilbie
alexbilbie / README.md
Last active August 29, 2015 14:11
StackPHP basic API versioned routes example

Setup

$ composer install
$ php -S localhost:8000

Version 1.0 call:

curl -X "GET" "http://localhost:8000/index.php/foo" -H "Accept: 1.0"

@alexbilbie
alexbilbie / README.md
Last active August 29, 2015 14:10 — forked from nicola/README.md

This is part of a set of visualisation that try to improve the Barclay's bike distribution in London. Visualizing the map of the London Tube is the first step to understand any correlation with bikes usage.

Aim

The technical aim I tried to achieve, is a very simple codebase that enables interaction (such as zooming) for later data analysis.

Inspiration

I have been using RandomETC's idea. However, in order to support scaling and to have a more structured code-base, most of the code has been re-written.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexbilbie
alexbilbie / gist:10631296
Created April 14, 2014 09:21
keybase.md
### Keybase proof
I hereby claim:
* I am alexbilbie on github.
* I am alexbilbie (https://keybase.io/alexbilbie) on keybase.
* I have a public key whose fingerprint is 787C F453 80C4 F437 BE1F D9F9 C4C2 C8B8 01C0 64A7
To claim this, I am signing this object:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
####################################################################################################
# PrimeWireProxy.co.uk - a reverse proxy to allow blocked users access to PrimeWire.ag.
#
# When ever a proxy falls victim to internet censorship, another needs to replace it. A single,
# cheap ($15 per month) VPS is all you need to provide this service to others. NGINX is brilliant
# for this and will serve thousands of requests with no trouble. Just replace `primewire.ag` and
# `primewireproxy.co.uk` below to suite your needs.
#
# Say NO to Internet Censorship!
#
@alexbilbie
alexbilbie / gist:6976275
Created October 14, 2013 14:10
Find nodes with duplicate properties
// Replace <INDEX> and <PROPERTY>
START n=node:<INDEX>('*:*')
WITH n
ORDER BY id(n) DESC // Order by descending to delete the most recent duplicated record
WITH n.<PROPERTY>? as DuplicateKey, COUNT(n) as ColCount, COLLECT(id(n)) as ColNode
WITH DuplicateKey, ColCount, ColNode, HEAD(ColNode) as DuplicateId
WHERE ColCount > 1 AND (DuplicateKey is not null) AND (DuplicateId is not null)
WITH DuplicateKey, ColCount, ColNode, DuplicateId