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 | |
// include symfony2 bootstrap | |
include 'bootstrap.php.cache'; | |
abstract class BaseTestCase extends \Symfony\Bundle\FrameworkBundle\Test\WebTestCase | |
{ | |
protected $client; | |
public function setUp() |
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 variables | |
SF2_ENVIRONMENT=prod | |
REPOSITORY= | |
DEPLOY_BASE_DIR=/var/www | |
DEPLOY_DIR=$DEPLOY_BASE_DIR/`date +%s` | |
USAGE="Usage: $0 install|update [git_repository_url]" | |
# Commands |
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
[pagerfanta] | |
git=http://github.com/whiteoctober/Pagerfanta.git | |
[WhiteOctoberPagerfantaBundle] | |
git=http://github.com/whiteoctober/WhiteOctoberPagerfantaBundle.git | |
target=/bundles/WhiteOctober/PagerfantaBundle | |
version=origin/symfony2.0 |
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
/** | |
* @param FilterResponseEvent $event | |
*/ | |
public function onResponse(FilterResponseEvent $event) | |
{ | |
$cookie = new Cookie('my_id', 1); | |
$response = $event->getResponse(); | |
$response->headers->setCookie($cookie); | |
} |
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 | |
// autloload.php.dist | |
$vendorDir = __DIR__.'/../../../../../vendor'; | |
echo realpath($vendorDir); | |
require_once $vendorDir.'/symfony/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php'; | |
use Symfony\Component\ClassLoader\UniversalClassLoader; | |
$loader = new UniversalClassLoader(); |
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
{ | |
"name": "my/custom-name", | |
"autoload": { | |
"psr-0": { "": "src/" } | |
}, | |
"repositories": [ | |
{"type": "composer", "url": "http://192.168.11.5/satis/web" }, | |
{"type" : "pear", "url": "pear.amazonwebservices.com"} | |
], | |
"require": { |
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 Form\Handler; | |
use Symfony\Component\Form\Form; | |
use Symfony\Component\HttpFoundation\Request; | |
use Doctrine\Common\Persistence\ObjectManager; | |
use Form\Handler\FormHandlerInterface; | |
/** |
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 | |
/** | |
* Implementation of Vose's Alias Method | |
* | |
* @param array $probabilities An array of probabilities | |
* | |
* @return int | |
*/ | |
public function aliasMethod(array $probabilities) |
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 | |
/** | |
* Implementation of Vose's Alias Method | |
* | |
* @param array $probabilities An array of probabilities | |
* | |
* @return int | |
*/ | |
public function aliasMethod(array $probabilities) | |
{ |
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 method fetches a list of servers to deploy to from the puppetmaster | |
def get_servers(system_role) | |
require 'net/https' | |
http = Net::HTTP.new("puppetmaster.hostname", 8140) | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_NONE | |
response = http.get2("/production/facts_search/search?facts.system_role=#{system_role}", "Accept" => "yaml") | |
require 'yaml' |
OlderNewer