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.
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.
Because Varnish doesn't support SSL, most people choose a setup where Nginx SSL will forward all traffic to Varnish and Varnish will forward will forward the traffic it cannot handle back to nginx. Or worse, bind Varnish on port 80 and direct all traffic into Varnish. This will already degrade performance, because Varnish will purge more because static files are also taking up room in the cache.
Next up, the Nginx configuration of Magento will handle static files.
| set :application, "App Name" # Your app name | |
| set :repository, "git@github.com:xxxxx/xxx.git" # Your git repository | |
| set :document_root, "/home/user/www/awesome_app" | |
| set :deploy_via, :remote_cache | |
| # SSH Settings | |
| set :user, "user_ssh" | |
| set :password, "password_ssh" | |
| set :use_sudo, false |
| /* | |
| * Normalized hide address bar for iOS & Android | |
| * (c) Scott Jehl, scottjehl.com | |
| * MIT License | |
| */ | |
| (function( win ){ | |
| var doc = win.document; | |
| // If there's a hash, or addEventListener is undefined, stop here | |
| if( !location.hash && win.addEventListener ){ |
| <?php | |
| class Csv | |
| { | |
| public static function fromArray($rows, $delimiter = ',') | |
| { | |
| if (empty($rows)) { | |
| return ''; | |
| } |
| <?php | |
| use SimpleXMLElement; | |
| class Xml { | |
| /** | |
| * @param array $data | |
| * @param string $root | |
| * @return SimpleXMLElement |
| <?php | |
| // Originally by Andrew Moore | |
| // Src: http://stackoverflow.com/questions/4795385/how-do-you-use-bcrypt-for-hashing-passwords-in-php/6337021#6337021 | |
| // | |
| // Heavily modified by Robert Kosek, from data at php.net/crypt | |
| class Bcrypt { | |
| private $rounds; | |
| private $prefix; |
| <?php | |
| /* 1. Add the dependency to your composer.json. | |
| // I'm using https://packagist.org/packages/tijsverkoyen/css-to-inline-styles | |
| */ | |
| /* 2. Extend \Illuminate\Mail\Mailer to override the getView() method | |
| // app/libraries/MyApp/Mailer.php | |
| */ | |
| namespace MyApp\Mail; |