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
create user <user>@localhost; | |
set password for <user>@localhost = PASSWORD("xxx"); | |
grant all privileges on wordpress_<app>.* to <user>@localhost identified by "xxx"; | |
flush privileges; |
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
// Place your key bindings in this file to overwrite the defaults | |
[ | |
{ | |
"key": "cmd+t", | |
"command": "workbench.action.quickOpen" | |
}, | |
{ | |
"key": "cmd+p", | |
"command": "workbench.action.showAllSymbols" | |
}, |
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
// Place your settings in this file to overwrite the default settings | |
{ | |
"editor.insertSpaces": false, | |
"editor.fontFamily": "Menlo, Monaco, Menlo, 'Courier New', monospace", | |
"editor.fontSize": 14, | |
"workbench.editor.enablePreviewFromQuickOpen": false, | |
"editor.fontSize": 12, | |
"editor.rulers": [120], | |
} |
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
{ | |
"comment block": { | |
"prefix": "comment", | |
"body": [ | |
"/* ", | |
" * --------------------------------------------------------------------", | |
" * ${title}", | |
" * --------------------------------------------------------------------", | |
" * ${description}", | |
" *", |
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
{ | |
"html boilerplate": { | |
"prefix": "html", | |
"body": [ | |
"<doctype html>", | |
"<head>", | |
"\t<meta charset=\"utf-8\">", | |
"\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">", | |
"\t<meta name=\"author\" content=\"Andre Goncalves\" />", | |
"\t<meta name=\"viewport\" content=\"width=device-width,minimum-scale=1\">", |
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
{ | |
"boot": { | |
"prefix": "css", | |
"body": [ | |
"/**", | |
" *", | |
" * Copyright 2016 Andre Goncalves. All rights reserved.", | |
" *", | |
"*/", | |
"", |
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 | |
// php -S localhost:3000 router.php | |
$root = $_SERVER['DOCUMENT_ROOT']; | |
chdir($root); | |
$path = '/'.ltrim(parse_url($_SERVER['REQUEST_URI'])['path'],'/'); | |
set_include_path(get_include_path().':'.__DIR__); | |
if(file_exists($root.$path)) | |
{ | |
if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/') |
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 | |
# parse error logs on your server and send you daily updates to email | |
# configure options | |
EMAIL=<...> | |
WORKDIR="/root" | |
TAIL=5 # number of entries to send | |
IGNORE="/backup" # path to ignore | |
LOG_FILENAME = "error.log" |
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 | |
# simple cron script to check disk space and send notifications | |
#cd $(dirname $0) && pwd | |
if [ "$(cd $(dirname $0) && pwd)" != "/etc/cron.hourly" ]; then | |
echo "Warning: script should be located in /etc/cron.hourly for periodic checks" | |
fi | |
CONFIG_FILE=/etc/check-disk-space.conf |
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 | |
$root = $_SERVER['DOCUMENT_ROOT']; | |
chdir($root); | |
$path = '/'.ltrim(parse_url($_SERVER['REQUEST_URI'])['path'],'/'); | |
set_include_path(get_include_path().':'.__DIR__); | |
if(file_exists($root.$path)) | |
{ | |
if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/') | |
$path = rtrim($path,'/').'/index.php'; | |
if(strpos($path,'.php') === false) return false; |