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 port install dnsmasq | |
sudo port load dnsmasq | |
# add "address=/dev/your.vm.ip.address" to the end of /opt/local/etc/dnsmasq.conf | |
sudo mkdir -p /etc/resolver | |
sudo tee /etc/resolver/dev >/dev/null <<EOF | |
nameserver 127.0.0.1 | |
EOF |
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 | |
echo html_entity_decode("Greek question mark: ;"); |
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
export XDEBUG_CONFIG="idekey=PHPSTORM remote_host=172.28.128.1 remote_port=9000" | |
export PHP_IDE_CONFIG="serverName=your.phpstorm.server.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
<?php | |
$maxiter = 10000000; | |
$value = "1234"; | |
$time_start = microtime(true); | |
for ($i = 0; $i < $maxiter; ++$i) { | |
$string = "This is " . $value; | |
} |
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
xdebug.remote_connect_back=1 | |
xdebug.remote_enable=1 | |
xdebug.remote_port=9000 | |
xdebug.remote_autostart=1 | |
xdebug.show_exception_trace=0 | |
xdebug.show_local_vars=0 | |
xdebug.var_display_max_data=10000 | |
xdebug.var_display_max_depth=20 | |
xdebug.profiler_output_dir=/tmp | |
xdebug.idekey=PHPSTORM |
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
#task to add 'parameters:' to an empty parameters file | |
task :fix_empty_parameters_yml | |
do | |
parameters_path = "app/config/parameters.yml" | |
run "LEN=$(cat #{shared_path}/#{parameters_path} | wc -c); if [ $LEN -eq 0 ] ; then echo \"parameters:\" > #{shared_path}/#{parameters_path} ; fi" | |
end | |
#run the parameters fix task before composer kicks off | |
before "symfony:composer:install", "fix_empty_parameters_yml" |
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 | |
$env = 'prod'; | |
$debug = false; | |
if(isset($_SERVER['APP_KERNEL'])) { | |
switch($_SERVER['APP_KERNEL']) { | |
case 'test': | |
case 'qa': | |
case 'dev': |
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 Click\SiteBundle\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use Symfony\Component\Validator\Constraints as Assert; | |
use Symfony\Component\HttpFoundation\File\UploadedFile; | |
/** | |
* Click\SiteBundle\Entity\Episode |
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
'use strict'; | |
var dbSession = require('./dbSession.js'); | |
var Percolator = require('percolator').Percolator; | |
var Server = function (port) { | |
var server = Percolator({'port': port, 'autoLink': false, 'staticDir': __dirname + '/../frontend'}); | |
server.route( | |
'/api/keywords', |
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 | |
/** | |
* Lock files are no end of pain, especially ensuring they are correctly removed when things blow up. | |
* This way there are never any artifacts left around, so nothing to clean up. | |
*/ | |
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); | |
if($socket === false) { | |
throw new \Exception("Cannot create a socket, please check system configuration"); | |
} |
OlderNewer