Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
<?php | |
/* html_convert_entities($string) -- convert named HTML entities to | |
* XML-compatible numeric entities. | |
*/ | |
function html_convert_entities($string) { | |
return preg_replace_callback('/&([a-zA-Z][a-zA-Z0-9]+);/S', | |
'convert_entity', $string); | |
} |
require File.join(File.dirname(__FILE__), 'deploy/nginx') | |
require File.join(File.dirname(__FILE__), 'deploy/log') | |
default_run_options[:pty] = true | |
set :ssh_options, { :forward_agent => true } | |
set :application, "appname" | |
set :repository, "git@giturl" | |
set :scm, :git |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
#/bin/sh | |
setfacl -R -m u:apache:rwx app/cache app/logs | |
setfacl -R -d -m u:apache:rwx app/cache app/logs | |
setfacl -R -m u:kuba:rwx app/cache app/logs | |
setfacl -R -d -m u:kuba:rwx app/cache app/logs | |
setfacl -R -m mask:rwx app/cache app/logs | |
setfacl -R -d -m mask:rwx app/cache app/logs |
<?php | |
namespace Examplecms\Bundle\ExampleCoreBundle\Form\EventListener; | |
use Examplecms\Bundle\ExampleCoreBundle\Form\GroupTreeType; | |
use Symfony\Component\Form\Event\DataEvent, | |
Symfony\Component\Form\FormEvents, | |
Symfony\Component\Form\FormFactoryInterface, | |
Symfony\Component\EventDispatcher\EventSubscriberInterface; |
#!/bin/sh | |
# | |
# Symfony2 App/Console autocompletion (commands and arguments only) | |
# | |
# Usable for both bash and zsh (probably) | |
# | |
# Usage: | |
# Load the script (or add to your .bashrc) | |
# | |
# source ./complete_console.sh |
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
<?php | |
require_once dirname(__FILE__) . '/../lib/simpletest/autorun.php'; | |
function retry($f, $delay = 10, $retries = 3) | |
{ | |
try { | |
return $f(); | |
} catch (Exception $e) { | |
if ($retries > 0) { | |
sleep($delay); |
In order to obtain all your Open source Pull-Request history:
Go to Google bigquery and execute the following query replacing liuggio
with your GitHub login
execute query
SELECT repository_url, repository_owner, repository_name, count(*) as numberOfPR
FROM [githubarchive:github.timeline]
WHERE payload_pull_request_head_repo_owner_login = "liuggio"
<?php | |
// ... | |
$awardCount = count($this->finder); | |
foreach ($this->finder as $file /** @var $file \SplFileInfo */) { | |
try { |