Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
set -e
sudo route -n delete 172.17.0.0/16
sudo route -n add 172.17.0.0/16 local.docker
DOCKER_INTERFACE=$(route get local.docker | grep interface: | cut -f 2 -d: | tr -d ' ')
DOCKER_INTERFACE_MEMBERSHIP=$(ifconfig "${DOCKER_INTERFACE}" | grep member: | cut -f 2 -d: | cut -c 2-4)
@deizel
deizel / keybase.md
Created February 22, 2016 02:00
keybase prove github deizel

Keybase proof

I hereby claim:

  • I am deizel on github.
  • I am deizel (https://keybase.io/deizel) on keybase.
  • I have a public key ASCPDlKpiQTlFfqLAA74eY_hXEiy9vMF3NF6owa2M3LLCAo

To claim this, I am signing this object:

@deizel
deizel / travis.yml
Last active October 10, 2015 23:37 — forked from Phillaf/travis.yml
language: php
php:
- 5.5
- 5.6
- 7.0
sudo: false
env:
@deizel
deizel / -
Created October 10, 2015 22:43
*** composer.lock 2015-10-07 20:19:52.000000000 -0500
--- /tmp/royalty/ApiGen/composer.lock 2015-10-10 17:28:03.000000000 -0500
***************
*** 6,9 ****
],
! "hash": "b9d08183efa4f1d45cb3c4a2523ffd8c",
! "content-hash": "b1bbcac7ab9bdbe9e02a4a0a4ce0ebaf",
"packages": [
--- 6,9 ----
],
@deizel
deizel / .gitignore
Last active October 11, 2015 12:08
Quickly set up a bunch of PHP projects (without dependencies) from Composer cache
build/
@deizel
deizel / collection.php
Created August 13, 2015 20:07
Example of CakePHP Collection
<?php
$countries = ['Denmark', 'Netherlands', 'France'];
$types = ['Italian', 'Japanese', 'Chinese'];
collection($countries)
->unfold(function ($country) use ($types) {
foreach ($types as $type) {
yield $country => $type;
}
})
@deizel
deizel / README.md
Created July 31, 2015 20:11
Multiple global Composer installations

Multiple global Composer installations

When setting up CI servers, it can sometimes be necessary to have different versions of Composer dependencies installed globally.

For example, when your CI server mainly deals with CakePHP 2.x and 3.x applications, where the coding standards vary.

This guide aims to walk you through how one might acheive this.

Composer home

@deizel
deizel / ruleset.xml.diff
Created July 31, 2015 17:28
Temporary workaround for https://youtrack.jetbrains.com/issue/WI-17740 (~/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/CakePHP)
diff --git i/ruleset.xml w/ruleset.xml
index 89c13c9..672d340 100644
--- i/ruleset.xml
+++ w/ruleset.xml
@@ -98,16 +98,16 @@
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.NamingConventions.ValidFunctionName">
- <exclude-pattern>*/src/*</exclude-pattern>
- <exclude-pattern>*/tests/*</exclude-pattern>
@deizel
deizel / gist:9230ab493ada786358bf
Last active August 3, 2017 21:52
List of constants in CakePHP 3.0
deizel at CakeDC in ~/Projects/cakephp (3.0●)
$ ag "const "
src/Console/ConsoleOutput.php
51: const RAW = 0;
58: const PLAIN = 1;
65: const COLOR = 2;
72: const LF = PHP_EOL;
src/Console/ConsoleIo.php
58: const VERBOSE = 2;