Skip to content

Instantly share code, notes, and snippets.

Andrew Carter AndrewCarterUK

Block or report user

Report or block AndrewCarterUK

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@AndrewCarterUK
AndrewCarterUK / results.dat
Last active Apr 24, 2019
CompareStrings function results
View results.dat
s1 s2 t1 t2 t3 t4 t5 Time (s) Error
Z A 4401022 4433686 4393924 4397724 4405599 4.41 0.0071
Z B 4377687 4367294 4370573 4376585 4375585 4.37 0.0020
A Z 4600099 4608625 4620227 4605502 4631544 4.61 0.0056
B Z 4593608 4604220 4577180 4586942 4639593 4.60 0.0108
A A 5980992 5983767 6020037 5977564 5987625 5.99 0.0077
A B 6230444 6116568 6103291 6141156 6176039 6.15 0.0229
B B 5871883 5892847 5886045 5889816 5927863 5.89 0.0093
B A 6156191 6023669 6111652 6269249 6231587 6.16 0.0436
@AndrewCarterUK
AndrewCarterUK / bcrypt-test.cpp
Last active Apr 26, 2019
Evaluation of whether the CompareStrings function within node.bcrypt.js is timing safe
View bcrypt-test.cpp
#include <stdio.h>
#include <string.h>
#include <ctime>
// Taken from https://github.com/kelektiv/node.bcrypt.js
bool CompareStrings(const char* s1, const char* s2) {
bool eq = true;
int s1_len = strlen(s1);
int s2_len = strlen(s2);
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·
Compile:
gcc test.c -lwiringPi -o test
@AndrewCarterUK
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
* http://www.bbc.co.uk/programmes/articles/5wkxjTtqRvq8Cyrrjxtk7tc/puzzle-for-today
*
* 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
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
<?php
class GPS
{
private $serialFile;
public function __construct($serialFile)
{
$this->serialFile = $serialFile;
}
@AndrewCarterUK
AndrewCarterUK / sitepoint-survey-parser.php
Last active May 12, 2016
Verifying PHPixie fraud on SitePoint survey
View sitepoint-survey-parser.php
<?php
// https://raw.githubusercontent.com/sitepoint-editors/php-fw-survey-2015/master/dump/survey.csv
$stream = fopen('survey.csv', 'r');
$headers = fgetcsv($stream);
$count = 0;
$phpixieCount = 0;
$nonPhpixieErrorCount = 0;
@AndrewCarterUK
AndrewCarterUK / phpixie-stats.php
Created May 9, 2016
Script used to verify fraudulent installs on PHPixie.
View phpixie-stats.php
<?php
function getJsonPage($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
@AndrewCarterUK
AndrewCarterUK / phpixie-sockpuppets.md
Last active Oct 28, 2017
PHPixie using sockpuppets on /r/php
View phpixie-sockpuppets.md

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 ( http://i.imgur.com/WznceCf.gif ) 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
AndrewCarterUK / class-preloading.php
Last active Feb 12, 2016
Class "preloading" with Composer
View class-preloading.php
<?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
<?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;
You can’t perform that action at this time.