readme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import redis | |
import timeit | |
NUM_OF_USERS = 10000 | |
KEY_USERS = 'test:users' | |
KEY_USER = 'test:user:%s' | |
REPEAT = (7, 1) | |
print "* working with %s items" % NUM_OF_USERS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print 'interpolate the %s out of me' % 'heck' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo sprintf('interpolate the %s out of me', 'heck'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd `dirname $0` | |
curl -s http://getcomposer.org/installer | php | |
php composer.phar install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# crucial to allow the install.sh script to update Silex | |
unset GIT_DIR | |
GIT_WORK_TREE=/home/myuser/mysilexapp.git git checkout -f | |
# I like to do a sanity check of the files as there's no output from git checkout | |
ls -la /home/myuser/mysilexapp/ | |
# execute an install script seperating project logic from git | |
/home/myuser/mysilexapp/install.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author James Morris <james@jmoz.co.uk> | |
*/ | |
$html = <<<'EOF' | |
<html> | |
<body> | |
<h1>Foo</h1> | |
<div id="content"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jms_security_extra: | |
expressions: true | |
method_access_control: | |
'^TimeOutTaxonomyAdminBundle:Default:.*': 'hasRole("ROLE_TAXONOMY_VIEW")' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace TimeOut\Bundle\SecurityBundle\DataFixtures; | |
use Doctrine\Common\DataFixtures\FixtureInterface; | |
use TimeOut\Bundle\SecurityBundle\Entity\User; | |
use TimeOut\Bundle\SecurityBundle\Entity\Role; | |
/** | |
* Load test users. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace JMOZ\Bundle\SecurityBundle\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Doctrine\Common\Collections\Collection; | |
use FOS\UserBundle\Model\User as BaseUser; | |
/** |