Skip to content

Instantly share code, notes, and snippets.

parameters:
dynamic.db.name: db1
doctrine:
dbal:
default_connection: db1
connections:
db1:
dbname: %dynamic.db.name%
user: db1_user
@lsmith77
lsmith77 / gist:872143
Created March 16, 2011 07:25
Add License info to Repository meta data
The symfony project is currently exploring ways to ensure that code contributors are aware that any pull request they send implies that their code is contributed under the MIT license. We are currently not yet convinced that we need a full blown CLA, especially since we are concerned about adding needless hurdles for contributions that git just so nicely reduced. Likely other projects have similar concerns.
So the idea is the following:
- In a git repository the admin can configure the location of the license file (either inside the repo or in theory also out side of the repo)
- In order to make life easier for users, github could provide template files so that they can easily add them to their repository
- Using those template files also makes it possible for github to determine the name of the license (aka when symfony uses the github MIT license template, then guthub can easily determine automatically that symfony uses the MIT license)
- The license information then becomes searchable.
- Maybe users can e
@lsmith77
lsmith77 / gist:4078842
Created November 15, 2012 14:22
stripping cookies for caching when using the Symfony2 HttpCache
<?php
require_once __DIR__.'/AppKernel.php';
use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class AppCache extends HttpCache
{
@lsmith77
lsmith77 / performance optimization gone wrong
Created November 23, 2012 15:37
we added MultivaluePropertyCollection to more efficiently handle detection if an array property in PHPCR ODM changed or not .. guess we actually reduced performance and prevented people from using array functions easily .. doh!
<?php
require 'vendor/doctrine/common/lib/Doctrine/Common/Collections/Collection.php';
require 'vendor/doctrine/common/lib/Doctrine/Common/Collections/Selectable.php';
require 'vendor/doctrine/common/lib/Doctrine/Common/Collections/ArrayCollection.php';
require 'vendor/doctrine/phpcr-odm/lib/Doctrine/ODM/PHPCR/PersistentCollection.php';
require 'vendor/doctrine/phpcr-odm/lib/Doctrine/ODM/PHPCR/MultivaluePropertyCollection.php';
use Doctrine\Common\Collections\ArrayCollection;
@lsmith77
lsmith77 / gist:4194191
Created December 3, 2012 10:57
matching a list of prefixes, preg_match is of course also more flexible, but it seems like its also going to be faster in many cases
<?php
$iterations = 10000;
$url = '/foo/bar';
$list1 = array('/bar', '/ding', 'dong');
$list2 = array('/foo', '/bar', '/ding', 'dong');
$regexp1 = '/^\/(bar|ding|dong)/';
$regexp2 = '/^\/(bar|foo|ding|dong)/';
@lsmith77
lsmith77 / oss crowdfunding sites
Created February 8, 2013 08:54
List of crowd funding services that could be relevant for OSS projects
oss focused:
https://bountyoss.com
http://beex.org
http://www.freedomsponsors.org
http://selfstarter.us
not oss focused:
http://flattr.com
http://pledgie.com
http://www.launcht.com
empty result
SELECT
n0.id AS id,
n0.path AS path,
n0.parent AS parent,
n0.local_name AS local_name,
n0.namespace AS namespace,
n0.workspace_name AS workspace_name,
n0.identifier AS identifier,
<?php
interface ExceptionInterface
{
public function getMessage();
public function getCode();
public function getFile();

Keybase proof

I hereby claim:

  • I am lsmith77 on github.
  • I am lsmith (https://keybase.io/lsmith) on keybase.
  • I have a public key whose fingerprint is 280C F185 F4AF A00F EE49 3F71 0D4E 225B 7B2F 7EDC

To claim this, I am signing this object:

@lsmith77
lsmith77 / gist:93a9c4431ad1bbe9f06a
Created June 30, 2014 09:03
Compiling Oak from source and installing MongoDB via homebrew
brew update
brew outdated
brew upgrade
brew install maven
brew install mongodb
mongod --config /usr/local/etc/mongod.conf
wget http://www.eu.apache.org/dist/jackrabbit/oak/1.0.1/jackrabbit-oak-1.0.1-src.zip