Instantly share code, notes, and snippets.

Andrew Carter AndrewCarterUK

View GitHub Profile
View test.c
This program attempts to change the operation mode of a SX1276.
SPI communication is verified as working, as the program is able to select and verify sleep mode.
The SX1276 refuses to enter RXCONTINUOS mode and instead reverts back to STDBY·
gcc test.c -lwiringPi -o test
AndrewCarterUK / gchq-puzzle.c
Last active Jul 3, 2017
Programming solution to the GCHQ puzzle on BBC Radio 4, Mon 3rd July 2017
View gchq-puzzle.c
* Programming solution to the GCHQ puzzle on BBC Radio 4, Mon 3rd July 2017
* Output:
* 4 -> 123+45-67+8-9
* 4 -> 123+4-5+67-89
* 3 -> 123-45-67+89
* 6 -> 123-4-5-6-7+8-9
* 6 -> 12+3+4+5-6-7+89
AndrewCarterUK / GPS.php
Last active Aug 10, 2016
GPS NMEA Parser in PHP. Tested on a Raspberry Pi with a GY-GPS6MU2.
View GPS.php
class GPS
private $serialFile;
public function __construct($serialFile)
$this->serialFile = $serialFile;
AndrewCarterUK / sitepoint-survey-parser.php
Last active May 12, 2016
Verifying PHPixie fraud on SitePoint survey
View sitepoint-survey-parser.php
$stream = fopen('survey.csv', 'r');
$headers = fgetcsv($stream);
$count = 0;
$phpixieCount = 0;
$nonPhpixieErrorCount = 0;
AndrewCarterUK / phpixie-stats.php
Created May 9, 2016
Script used to verify fraudulent installs on PHPixie.
View phpixie-stats.php
function getJsonPage($url)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
AndrewCarterUK /
Last active Oct 28, 2017
PHPixie using sockpuppets on /r/php

See this thread here

/u/dracony Based on the previous comments I updated the base auth project to include separate user and admin logins (totaly separate auth domains), added a .gif demo for the lazy ( ) and the ability to impersonate users.

/u/phpgeek Wow, that's actually something I could use.

/u/underdogging10 Just gonna throw this out there... but you seem to always post positively on any PHPixie post shortly after it is posted. Pretty sure this is just /u/dracony. In fact, basically everything you have posted over the last 3 months is just praise of PHPixie.

AndrewCarterUK / class-preloading.php
Last active Feb 12, 2016
Class "preloading" with Composer
View class-preloading.php
This should work because composer registers a callback using
'spl_autoload_register' for when a class is used that has not
already been loaded. Loading the class before hand will
prevent that callback being triggered by PHP.
View Event Loop Dreaming.php
* What an async proxy server might look like in PHP with a PSR for event loops
use EventLoopImplementation\EventLoop;
use HttpClientImplementation\HttpClient;
use HttpServerImplementation\HttpServer;
use PromiseImplementation\Promise;
AndrewCarterUK / psr-6-testing-example.php
Created Sep 30, 2015
PSR-6 Pool::resolveItem() Testing Example
View psr-6-testing-example.php
class MyClass
private $pool;
public function __construct(CacheItemPoolInterface $pool) { $this->pool = $pool; }
public function getDataA($param)
return $this->pool->resolveItem(
AndrewCarterUK /
Last active Sep 4, 2015
Talk Proposal: Breaking Boundaries with FastCGI

Breaking Boundaries with FastCGI

Efficient and performant applications are fantastic; they keep server load, costs and response times low. We can make our web applications more efficient by removing the repetitive bootstrapping process from the request-response cycle.

"How?" I hear you ask!

By using FastCGI we can keep our application alive between requests and vastly improve their performance. The best news is that if you're using a Request-Response framework (such as Symfony) you can probably do this to your application by adding one line to your composer dependencies file.

Let us not get too excited, however! When using PHP in this way we have to be very careful about the design and configuration of our application! This talk will explain how to use FastCGI with our applications safely, providing an overview of the process and highlighting the danger areas that we must be cautious of.