Skip to content

Instantly share code, notes, and snippets.

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

Core

symphony/workspace

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

Symphony

Baseline

  • 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
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/mod_authz_core.so (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/mod_unixd.so
  • Symlink this into mods-enabled
#!/bin/bash
DOZIP=false
DODELETE=false
DODOCS=false
while getopts "v:zrd" opt; do
case $opt in
v)
VERSION=$OPTARG
@brendo
brendo / test.php
Last active August 29, 2015 14:15
Symfony Routing bug?
<?php
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
"DELETE
FROM `tbl_sessions`
WHERE `session` = '%s'",
- $this->database->cleanValue($session_id)
+ $this->database->cleanValue($key)