The setup installs the following software:
- Nginx
- MySQL
- PHP
- Node
- Composer
<?php | |
use Illuminate\Database\Eloquent\Builder; | |
Builder::macro('toSqlWithBindings', function () { | |
$bindings = array_map( | |
fn ($value) => is_numeric($value) ? $value : "'{$value}'", | |
$this->getBindings() | |
); |
[Unit] | |
Description=supervisord - Supervisor process control system for UNIX | |
Documentation=http://supervisord.org | |
After=network.target | |
[Service] | |
Type=forking | |
ExecStart=/bin/supervisord -c /etc/supervisord/supervisord.conf | |
ExecReload=/bin/supervisorctl reload | |
ExecStop=/bin/supervisorctl shutdown |
Quick tip for handling CSRF Token Expiration - common issue is when you use csrf protection is that if | |
a form sits there for a while (like a login form, but any the same) the csrf token in the form will | |
expire & throw a strange error. | |
Handling it is simple, and is a good lesson for dealing with other types of errors in a custom manner. | |
In Middleware you will see a file VerifyCsrfToken.php and be tempted to handle things there. DON'T! | |
Instead, look at your app/Exceptions/Handler.php, at the render($request, Exception $e) function. | |
All of your exceptions go through here, unless you have excluded them in the $dontReport array at the |
[root@a59c35ad939a /]# yum install epel-release | |
Loaded plugins: fastestmirror | |
Setting up Install Process | |
Loading mirror speeds from cached hostfile | |
* base: ftp.riken.jp | |
* extras: ftp.riken.jp | |
* rpmforge: ftp.riken.jp | |
* updates: ftp.riken.jp | |
Resolving Dependencies | |
--> Running transaction check |
[ | |
{ "keys": ["super+b"], "command": "insert_snippet", "args": {"name": "Packages/User/bold.sublime-snippet"} }, | |
// Set context so shortcut works in HTML files only | |
{ "keys": ["super+b"], "command": "insert_snippet", "args": {"name": "Packages/User/bold.sublime-snippet"},"context":[{ "key": "selector", "operator": "equal", "operand": "text.html" }] } | |
] |
function Cache(config) { | |
config = config || {}; | |
config.trim = config.trim || 600; | |
config.ttl = config.ttl || 3600; | |
var data = {}; | |
var self = this; | |
var now = function() { | |
return new Date().getTime() / 1000; |
AF - Afghanistan | |
AL - Albania | |
DZ - Algeria | |
AS - American Samoa | |
AD - Andorra | |
AO - Angola | |
AI - Anguilla | |
AQ - Antarctica | |
AG - Antigua and Barbuda | |
AR - Argentina |
#!/bin/bash | |
target_branch="production" | |
working_tree="PATH_TO_DEPLOY" | |
while read oldrev newrev refname | |
do | |
branch=$(git rev-parse --symbolic --abbrev-ref $refname) | |
if [ -n "$branch" ] && [ "$target_branch" == "$branch" ]; then | |
/*! | |
* Scroll Sneak | |
* http://mrcoles.com/scroll-sneak/ | |
* | |
* Copyright 2010, Peter Coles | |
* Licensed under the MIT licenses. | |
* http://mrcoles.com/media/mit-license.txt | |
* | |
* Date: Mon Mar 8 10:00:00 2010 -0500 | |
*/ |