Skip to content

Instantly share code, notes, and snippets.

View antonbabenko's full-sized avatar
🇺🇦

Anton Babenko antonbabenko

🇺🇦
View GitHub Profile
@antonbabenko
antonbabenko / gist:2462549
Created April 22, 2012 07:47
git pre-commit phpcs hook
# https://github.com/s0enke/git-hooks/tree/master/phpcs-pre-commit/
curl -o .git/hooks/pre-commit https://raw.github.com/s0enke/git-hooks/master/phpcs-pre-commit/pre-commit
chmod +x .git/hooks/pre-commit
Specify Symfony2 as standards in pre-commit.
Also there is Netbeans plugin to verify coding style.
Profit! :)
@antonbabenko
antonbabenko / s3backup.sh
Created March 12, 2012 12:36
S3 files backup command
s3cmd --recursive --reduced-redundancy --skip-existing --no-delete-removed --acl-public sync s3://s3.domain.com/files/ s3://s3-backup.domain.com/files/
@antonbabenko
antonbabenko / curl_all.sh
Created January 12, 2012 14:44
Curl list of urls and save http response code & times (useful for cache warmup)
#!/bin/bash
while read LINE; do
curl -o /dev/null --silent --progress-bar --head --write-out '%{http_code} %{time_starttransfer} %{url_effective}\n' "$LINE" >> urls_result.txt
done < urls.txt
@antonbabenko
antonbabenko / README
Created October 25, 2011 18:38
Ticket #2388 (Symfony v2.0.4)
Instructions to reproduce the issue:
1) Download and unzip Symfony standard edition from here - http://symfony.com/download?v=Symfony_Standard_Vendors_2.0.4.tgz . It seems that this bug is not existing when do "git clone" and "bin/vendors install". Also this bug is not visible when using master or 2.0 branch.
2) Apply changes from files specified in this gist
3) Load http://localhost/Symfony/web/app_dev.php and see the error:
Fatal error: Allowed memory size of 1887436800 bytes exhausted (tried to allocate 523800 bytes) in /Users/Bob/Sites/Symfony/vendor/symfony/src/Symfony/Component/Translation/MessageCatalogue.php on line 127
Notes:
It happens only when translation key is not found in messages file, and cache is empty, and on first request (when reload the page session is restored and bug is not visible).