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 | |
/** | |
* zippers two arrays together, alternating values from each array | |
* | |
* @param array $array1 | |
* @param array $array2 | |
* @return array | |
*/ | |
function zipperArrays(array $array1, array $array2) { |
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 Problematic\UserBundle\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Problematic\UserBundle\Entity\User; | |
class RegistrationController extends Controller | |
{ |
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 | |
# Script for quick configuration of an EC2 Server | |
# Installs the necessaries for most PHP Jobs | |
# Run as Root or suffer the consequences of stuff telling you it can't get a lock and whatnot | |
ln -sf /usr/share/zoneinfo/America/Denver /etc/localtime | |
cd /etc/yum.repos.d |
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 | |
public function create(VoteInterface $vote, VotableCommentInterface $comment) | |
{ | |
$this->voteBlamer->blame($vote); | |
if (!$this->validator->validate($vote)) { | |
return false; | |
} |
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 | |
php bin/vendors install | |
php app/console doctrine:database:create | |
php app/console doctrine:schema:create | |
echo -n "Initialize ACLs (y/n)? " | |
read initACL | |
[ "$initACL" == "y" ] && php app/console init:acl |
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 Acme\UserBundle\Model; | |
use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface; | |
use Symfony\Component\Security\Core\User\UserInterface; | |
class UserFactory | |
{ | |
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 | |
echo "Truncating ACL class tables..." | |
php app/console doctrine:query:sql "TRUNCATE acl_classes" | |
php app/console doctrine:query:sql "TRUNCATE acl_entries" | |
php app/console doctrine:query:sql "TRUNCATE acl_object_identities" | |
php app/console doctrine:query:sql "TRUNCATE acl_object_identity_ancestors" | |
php app/console doctrine:query:sql "TRUNCATE acl_security_identities" | |
echo "Loading data fixtures..." |
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
#!/usr/bin/env php | |
<?php | |
require 'hashbang.php'; | |
$app = new HashBang(function($firstname, $lastname, $options) { | |
$output = "Hello, {$firstname}"; | |
if ($lastname) { | |
$output .= " {$lastname}"; | |
} |
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
# this will install everything as root, so take that into account before you run it | |
# need cmake, python development headers, ZLib and OpenSSL | |
sudo apt-get install cmake python2.7-dev zlib1g-dev libssl-dev | |
mkdir libgit && cd libgit | |
git clone git://github.com/libgit2/libgit2.git | |
cd libgit2 |
OlderNewer