Skip to content

Instantly share code, notes, and snippets.

<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'>
// Connect 4
// 7 across, 6 down
// | | | | | | | |
// | | | | | | |
const board = [
[0, 0, 0, 0, 0, 0, 0],
brendo / entities.dtd
Created January 22, 2017 03:40
XSLT and Entities
<!ENTITY world "world">
<!ENTITY copy "&#169;">
brendo / Symphony Project
Last active August 20, 2016 14:11
A modular approach for Symphony.



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 September 11, 2015 15:14
Musing about Symphony, rebuilt with modern concepts and tools



  • 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 March 19, 2015 03:09
Notes to me on upgrading from Mavericks to Yosemite
  • 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 August 29, 2015 14:15
Symfony Routing bug?
require __DIR__ . '/vendor/autoload.php';
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
$masterRoutes = new RouteCollection();
$routesA = new RouteCollection();
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)