Skip to content

Instantly share code, notes, and snippets.

@till
till / satis.json
Last active August 29, 2015 14:01
{
"repositories": [
{
"type": "package",
"package": {
"name": "fabpot/php-cs-fixer",
"version": "bleeding-edge",
"dist": {
"bin": ["php-cs-fixer.phar"],
"url": "http://get.sensiolabs.org/php-cs-fixer.phar",

Assuming you have the following tree and you want file operations on it, this is the minimum PHP you have to write to test it.

$ tree foo
foo
`-- bar

1 directory, 0 files
SELECT
req.urlShort,
req.resp_x_powered_by,
req.resp_server
FROM [httparchive:runs.latest_requests] AS req
WHERE (
REGEXP_MATCH(req.resp_server, r'PHP')
OR
REGEXP_MATCH(req.resp_x_powered_by, r'PHP')
)
@till
till / packaging.md
Last active August 29, 2015 14:14
CouchDB Packaging Discussion

CouchDB Packaging

People present:

  • Andy W.
  • Jan L.
  • Noah S.
  • Robert K.
  • Robert N.
  • Klaus T.
<?php
class A
{
public function hello(B $b)
{
echo "Hello {$b->person}" . PHP_EOL;
}
}
<?php
// an attempt to read data from a local nginx pushstream setup
$this->client = new Client('http://vm.local');
$request = $this->client->get(
'/sub/foo',
['Accept' => '*/*'],
['stream' => true],
);
$factory = new PhpStreamRequestFactory();
@till
till / .travis.yml
Created May 22, 2015 23:37
Here's a nice little PHP QA snippet to ensure quality in your PHP applications with Travis-CI.
language: php
script: bash php-qa.sh
==> Installing php55-tideways from tideways/homebrew-profiler
==> Downloading https://github.com/tideways/php-profiler-extension/archive/v2.0.7.zip
==> Downloading from https://codeload.github.com/tideways/php-profiler-extension/zip/v2.0.7
######################################################################## 100.0%
Warning: Cannot verify integrity of php55-tideways-v2.0.7.zip
A checksum was not provided for this resource
For your reference the SHA256 is: 6780061cc6145f7f6f342f7afd6beea2d1f8d31148441e08e799c962b785188f
==> /usr/local/opt/php55/bin/phpize
==> ./configure --prefix=/usr/local/Cellar/php55-tideways/v2.0.7 --with-php-config=/usr/local/opt/php55/bin/php-config
==> make
@till
till / gist:223136
Created October 31, 2009 16:18 — forked from janl/gist:223077
var till = "awesome";
var mathias = "win";
<?php
require_once 'HTTP/Request2.php';
class ArmChair extends HTTP_Request2
{
protected $server;
public function __construct($server)
{
$this->server = $server;
parent::__construct($server);