Skip to content

Instantly share code, notes, and snippets.

Pádraic Brady padraic

Block or report user

Report or block padraic

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
padraic / fail.php
Created Feb 27, 2014
Failure to capture certs on TLS verification failures.
View fail.php
$url = '';
$host = '';
$ciphers = implode(':', array(
padraic / RemoteFilesystem.php
Last active Aug 29, 2015
Composer RemoteFilesystem.php version showing missed peer_certificate (see tls-defaults branch on my fork)
View RemoteFilesystem.php
// when replaced for commit:
* This file is part of Composer.
* (c) Nils Adermann <>
* Jordi Boggiano <>
padraic / survey.php
Last active Aug 29, 2015
Enumerating Composer packages for PHPCS analysis and data collection
View survey.php
define('PACKAGE_LIST', 'list.txt');
define('CODING_STANDARD', 'PSR2');
define('SEVERITY', 1);
define('ENCODING', 'utf-8');
define('REPORT', 'source');
define('EXTENSIONS', 'php');
$excluded = [
padraic / checkciphers.php
Last active Nov 21, 2016
Comparing SSL/TLS ciphersuites for PHP 5.5, cURL and Mozilla
View checkciphers.php
* This script is designed as a simple tool to run comparisons between varying
* cipher suite lists used by PHP 5.5, cURL and Mozilla. The ciphersuites are
* are hardcoded and date to 01 February 2014
* The differences are restrictions, e.g. Mozilla diff from DEFAULT shows ciphers
* Mozilla has removed, etc. The differences should all be SSLv3 related.
padraic / checksslcontext.php
Last active Nov 16, 2016
Correct SSL/TLS Context Settings for file_get_contents() and other PHP stream calls under PHP 5.5 (or earlier)
View checksslcontext.php
ini_set('display_errors', 1);
* This script check how PHP makes HTTPS (SSL/TLS) requests using PHP Streams
* or cURL. Configuration options are passed as GET parameters, for example:
* http://localhost/checksslcontext.php?reconfigure=1
* Configuration:
* http://localhost/checksslcontext.php
* Basic PHP Streams using file_get_contents(). Default settings.
padraic / gist:4971487
Created Feb 17, 2013
Generating random numbers using mt_rand() or NOT!
View gist:4971487
for ($i=1; $i < 25; $i++) {
echo mt_rand(), PHP_EOL;
View xeedefense.php
$dom = new DOMDocument;
foreach ($dom->childNodes as $child) {
if ($child->nodeType === XML_DOCUMENT_TYPE_NODE) {
throw new \InvalidArgumentException(
'Invalid XML: Detected use of illegal DOCTYPE'
padraic /
Created Jul 7, 2012
Escaping RFC for PHP Core - Basically Zend\Escaper in C

* Version: 1.0

* Date: 2012-09-18

* Author: Pádraic <>

* Status: Under Discussion

* First Published at:

View gist:2989881
The following tasks need to be done to finish the i18n component:
To finish translator:
- Add Xliff translation loader with plural support if possible, see:
- Add Tmx translation loader (identify if plural support is available)
- Complete unit tests
padraic / .package.php
Created Apr 13, 2011
Package spec as a PHP 5.3 closure?
View .package.php
$package = function ($s) {
$s->name = 'Overlord';
$s->authors = 'Padraic Brady, Sauron[]';
$s->version = '0.0.1-dev';
$s->api_version = '0.0.1-dev';
$s->summary = 'Monitoring library for Hobbit Detector 1.0';
$s->description = file_get_contents(__DIR__ . '/description.txt');
$s->homepage = '';
You can’t perform that action at this time.