This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
# Download and install P4Merge from here: http://www.perforce.com/product/components/perforce-visual-merge-and-diff-tools | |
# And then add this to your Git config | |
[merge] | |
tool = p4mergetool | |
[mergetool "p4mergetool"] | |
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge $PWD/$BASE $PWD/$REMOTE $PWD/$LOCAL $PWD/$MERGED | |
trustExitCode = false | |
[diff] | |
tool = p4mergetool |
This file contains hidden or 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 hidden or 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 | |
# Put this file at: .git/hooks/post-checkout | |
# and make it executable | |
# You can install it system wide too, see http://stackoverflow.com/a/2293578/685587 | |
PREV_COMMIT=$1 | |
POST_COMMIT=$2 | |
NOCOLOR='\033[0m' |
This file contains hidden or 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"); | |
} |
This file contains hidden or 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 hidden or 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': |
NewerOlder