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 to be run as part of the github pre-push hook. | |
# | |
# Checks that, if there is a "version-like" tag being pushed, all the files which are supposed to contain the tag do | |
# actually have the correct tag value in them. If they do not, the push is blocked. | |
# NB: this does _not_ automatically alter the source files and commit them with the correct tag value, nor prevent the | |
# tag to be added to the wrong git commit locally (ie. a commit in which the source files have the wrong tag value). | |
# All it does is prevent the developer from pushing the 'bad tags' to remote repositories, giving him/her the chance to | |
# manually rectify the situation on the local repo before retrying to push. |
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 comment will be in the help text for a_task | |
function a_task() { | |
... | |
} | |
# prints this help text | |
function help() { | |
# @todo allow a tag such as `# @internal` to denote functions as not available for external execution | |
declare -A DESCRIPTIONS | |
local CMD MAX LEN |
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 | |
class MyClass | |
{ | |
protected $p = array(); | |
public function &__get($name) | |
{ | |
echo "Getting: $name\n"; | |
if (!isset($this->p[$name])) { |
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
sudo apt-get install graphviz | |
sudo pecl config-set preferred_state beta | |
sudo pecl install xhprof | |
# enable xhprof by creating a config. file for php: | |
sudo vi /etc/php5/apache2/conf.d/xhprof.ini | |
#in there put: | |
extension=xhprof.so | |
sudo service apache2 restart |
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
$dataManager = $this->getContainer()->get('liip_imagine.data.manager'); | |
$filterManager = $this->getContainer()->get('liip_imagine.filter.manager'); | |
$assetManager = $this->getContainer()->get('eris_fo.assets_manager'); | |
$variationManager = $this->getContainer()->get('eris_fo.assets.variation_generator'); | |
// works using the custom data loader as set in imaginebundle config | |
$fullSizeImagePath = '/images/content/advertising.png'; | |
$filters = $this->getContainer()->getParameter('assets_image_variations'); | |
$targetAssetsBucket = 'images'; |
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('../vendor/autoload.php'); | |
$clnt = new \PhpXmlRpc\Client('https://localhost/var/srv.php'); | |
$clnt->setAcceptedCompression(false); | |
$clnt->setSSLVerifyPeer(false); | |
$resp = $clnt->send(new \PhpXmlRpc\Request('yolo')); |
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\AppBundle\Command; | |
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
class ListLegacyScriptsCommand extends ContainerAwareCommand | |
{ |
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
class WebDriver extends AbstractWebDriver | |
{ | |
protected $proxy = ''; | |
public function setProxy($proxy) | |
{ | |
$this->proxy = $proxy; | |
} | |
/** |
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 | |
/** | |
* A simple process manager, forking jobs to run in parallel. Works on linux and windows. | |
* | |
* @copyright G. Giunta | |
* @license GPL v2 | |
* | |
* @todo add more methods? f.e. one to kill any the executing processes | |
*/ |
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 bash | |
# Looks in the legacy cache folder for any compiled legacy templates belonging to a specific design | |
# Useful to be put in a cronjob | |
DESIGN=my_site_design | |
VARDIR=my_site | |
# names of compiled templates files: ${sourcetpl}-hash.php | |
EXCLUDEDTEMPLATES=compiled/3- | |
ROOTDIR=$(dirname ${BASH_SOURCE[0]})/.. |
NewerOlder