Skip to content

Instantly share code, notes, and snippets.

View dlite-seamless-networking.sh
#!/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 Feb 22, 2016
keybase prove github deizel
View keybase.md

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:

View travis.yml
language: php
php:
- 5.5
- 5.6
- 7.0
sudo: false
env:
View -
*** 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 Oct 11, 2015
Quickly set up a bunch of PHP projects (without dependencies) from Composer cache
@deizel
deizel / collection.php
Created Aug 13, 2015
Example of CakePHP Collection
View collection.php
<?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 Jul 31, 2015
Multiple global Composer installations
View README.md

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 Jul 31, 2015
Temporary workaround for https://youtrack.jetbrains.com/issue/WI-17740 (~/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/CakePHP)
View ruleset.xml.diff
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>
View syntax.md
@deizel
deizel / gist:9230ab493ada786358bf
Last active Aug 3, 2017
List of constants in CakePHP 3.0
View gist:9230ab493ada786358bf
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;