Skip to content

Instantly share code, notes, and snippets.

View master.xml
<item id='1'>Fred</item>
<item id='2'>Jane</item>
<item id='3'>Bob</item>
<item id='4'>Mary</item>
<item id='6'>Tom</item>
<entry id='1'>
View connect4.js
// Connect 4
// 7 across, 6 down
// | | | | | | | |
// | | | | | | |
const board = [
[0, 0, 0, 0, 0, 0, 0],
brendo / entities.dtd
Created Jan 22, 2017
XSLT and Entities
View entities.dtd
<!ENTITY world "world">
<!ENTITY copy "&#169;">
brendo / Symphony Project
Last active Aug 20, 2016
A modular approach for Symphony.
View Symphony Project



The everyday developer will clone the workspace to create their project. This repository accepts Issues, Wiki and Pull Requests. All resources in here are custom to the specific project, all the dependencies will be resolved into /vendor. There are a few boilerplate files such conductor and index.php.

Favour convention approach, commands, datasources, events and sections are autodiscovered where possible, however some configuration may be required for the service container (if the items have dependencies). Needs fleshing out.

It will include:

brendo / Symphony
Created Sep 11, 2015
Musing about Symphony, rebuilt with modern concepts and tools
View Symphony



  • PHP 5.6+ (also tested on HHVM, PHP 7)
  • Code style PSR-2
  • Autoloading to PSR-4
  • Logging will be abstracted to PSR-3
  • Requests / Responses should follow PSR-7
  • Must have test coverage (consider a combination of Behat/PHPSpec, or even just PHP Unit)
brendo / gist:ac0a813a46e43cd357e4
Created Mar 19, 2015
Notes to me on upgrading from Mavericks to Yosemite
View gist:ac0a813a46e43cd357e4
  • Remove the httpd.conf file and replace it with the prexisting one
  • Remove the NameVirtualHost setting form the httpd.conf
  • Remove the symlink for authz_host.load from mods-enabled
  • Update the authz_host.load to include: LoadModule authz_core_module /usr/libexec/apache2/ (at the top)
  • Remove PHP 5.6, and reinstall with Homebrew
  • Symlink mod_filter ln -s ../mods-available/filter.load filter.load
  • Update deflate.conf and replace the mod_deflate with mod_filter
  • Update status.conf and remove the Order stuff (don't even bother adding it back? Not sure what I'm even using this for)
  • Create a unixd.load file in mods-available with the contents: LoadModule unixd_module /usr/libexec/apache2/
  • Symlink this into mods-enabled
while getopts "v:zrd" opt; do
case $opt in
brendo / test.php
Last active Aug 29, 2015
Symfony Routing bug?
View test.php
require __DIR__ . '/vendor/autoload.php';
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
$masterRoutes = new RouteCollection();
$routesA = new RouteCollection();
View gist:187fb680793f7c9d60ab
diff --git a/symphony/lib/core/class.databasesessionhandler.php b/symphony/lib/core/class.databasesessionhandler.php
index 5a4d517..6d480a5 100644
--- a/symphony/lib/core/class.databasesessionhandler.php
+++ b/symphony/lib/core/class.databasesessionhandler.php
@@ -88,7 +88,7 @@ class DatabaseSessionHandler implements SessionHandlerInterface
FROM `tbl_sessions`
WHERE `session` = '%s'",
- $this->database->cleanValue($session_id)
+ $this->database->cleanValue($key)