Chris Cornutt enygma

View keybase.md

Keybase proof

I hereby claim:

  • I am enygma on github.
  • I am ccornutt (https://keybase.io/ccornutt) on keybase.
  • I have a public key whose fingerprint is BA43 E518 8775 24EF ECC2 6831 D67D 8542 2535 DF94

To claim this, I am signing this object:

View gist:5372096
1 2 3 4 5 6 7 8 9 10
Executing step: Check out the repository
When directory "my-repo" does not exist
And I git clone "git.internal:/opt/git/my-repo"
>> Cloning into 'my-repo'...
Then change to directory "my-repo"
Then execute "pwd"
>> /Users/chris/work/picklebuild/my-repo
Then git checkout "release"
>> Switched to a new branch 'release'
>> Branch release set up to track remote branch release from origin.
View gist:3906604
1 2 3 4 5 6 7 8 9 10
<?php
/**
* When using Guzzle with self-signed certs, something recently changed that makes the
* previous manual config no longer work...see below
*/
 
// this no longer works
$init = array(
'curl.CURLOPT_SSL_VERIFYHOST' => false,
'curl.CURLOPT_SSL_VERIFYPEER' => false,
View gist:3494587
1 2 3 4 5 6 7 8 9 10
<?php
$r = new XMLReader();
$r->xml($post);
 
while ($r->read()) {
if ($r->nodeType == 10) {
$doc = $r->readOuterXML();
// see if we have any entities
preg_match_all('#<!ENTITY (.*?)>#ims',$doc,$matches);
if (!empty($matches[1])) {
View gist:2704894
1 2 3
[Behat\Behat\Exception\ErrorException]
Exception has been thrown in "beforeSuite" hook, defined in FeatureContext::initMinkSessions()
View gist:2704817
1 2 3 4 5 6 7 8 9 10
<?php
 
// autoload_namespace.php generated by Composer
 
$vendorDir = dirname(__DIR__);
$baseDir = dirname(dirname($vendorDir));
 
return array(
'Zend\\Validator' => $vendorDir . '/zendframework/zend-validator/php/',
'Zend\\Uri' => $vendorDir . '/zendframework/zend-uri/php/',
View gist:2704264
1 2 3 4 5 6 7 8 9 10
{
"require": {
"behat/behat": ">=2.2.2",
"behat/mink" : ">=1.3.2",
"guzzle/guzzle": ">=2.0.1",
"fabpot/goutte": "*",
"behat/sahi-client": "*",
"alexandresalome/php-selenium": "*",
"facebook/php-webdriver": "*"
},
View gist:2697434
1 2 3 4 5 6 7 8 9 10
<?php
class Controller_User extends Controller_Rest
{
protected function validateHash()
{
$request = file_get_contents('php://input');
$requestHeaders = apache_request_headers();
 
if (!isset($requestHeaders['X-Auth']) || !isset($requestHeaders['X-Auth-Hash'])) {
$this->response('fail!',401);
View gist:2205447
1 2 3 4 5 6 7 8 9 10
Feature: Testing the RESTfulness of the Index controller
Let's see how RESTish this is
 
Scenario: Creating a new User
Given that I want to make a new "User"
And that the its "name" is "Chris"
And I request "/user/index.json"
And the response is JSON
And the response has a "userId" property
And the type of the "userId" property is numeric
View gist:1413370
1 2 3 4 5 6 7 8 9 10
<?php
 
$jsonCacheFile = './quickfix.json';
$gimmieFeed = 'https://gimmebar.com/api/v0/public/assets/phpquickfix';
$wgetCmd = 'wget -O'.$jsonCacheFile.' '.$gimmieFeed;
 
// look for the cache file
if(!is_file($jsonCacheFile) || (is_file($jsonCacheFile) && filemtime($jsonCacheFile)<strtotime('-1 minute')) ){
// fetch the latest content from gimmiebar
exec($wgetCmd);
Something went wrong with that request. Please try again.