sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
- Download zsh-autosuggestions by
| /** | |
| * return the distance between two points. | |
| * | |
| * @param {number} x1 x position of first point | |
| * @param {number} y1 y position of first point | |
| * @param {number} x2 x position of second point | |
| * @param {number} y2 y position of second point | |
| * @return {number} distance between given points | |
| */ | |
| Math.getDistance = function( x1, y1, x2, y2 ) { | 
| function calculate_age($birthday) { | |
| $birthday_timestamp = strtotime($birthday); | |
| $age = date('Y') - date('Y', $birthday_timestamp); | |
| if (date('md', $birthday_timestamp) > date('md')) { | |
| $age--; | |
| } | |
| return $age; | |
| } | |
| //вызов функции | 
| encodeQueryFromArgs: function(args) { | |
| console.log(args); | |
| var result="?", counter = 1; | |
| // create enconded URL from args | |
| for (var key in args) { | |
| var keyValue = ""; | |
| if ( args[key] instanceof Array ) { | |
| /* | |
| * We are dealing with an array in the query string ?key=Value0&key=Value1 | 
| <?php | |
| if (! function_exists('dbd')) { | |
| /** | |
| * Showing all database queries. | |
| * Отображение всех запросов в базу. | |
| * | |
| * @param null|\Illuminate\Console\Command|\Psr\Log\LoggerInterface $channel | |
| */ | |
| function dbd($channel = null) | 
| <?php | |
| /** | |
| * use in blade template `{!! ex($message, ['br', 'strong']) !!}` | |
| */ | |
| if (!function_exists('ex')) { | |
| function ex($str, array $excluded) | |
| { | |
| $patterns = $tags = []; | |
| foreach ($excluded as $ex) { | |
| $open_tag = '<' . $ex . '>'; | 
| <?php | |
| require_once "vendor/autoload.php"; | |
| use Symfony\Component\Console\Application; | |
| use Illuminate\Database\Console\Migrations; | |
| use Pimple\Container; | |
| $container = new Container(); | |
| $container['migration-table'] = 'migration'; | 
| # Редиректы | |
| rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last; | |
| # Сам пост | |
| rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 last; | |
| rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last; | |
| rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last; | |
| rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 last; | |
| rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 last; | 
| rewrite ^/page/(.*)$ /index.php?cstart=$1 last; | |
| location / { | |
| rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/*$" /index.php?year=$1&month=$2&day=$3 last; | |
| rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)/*$" /index.php?year=$1&month=$2&day=$3&cstart=$4 last; | |
| rewrite "^/([0-9]{4})/([0-9]{2})/*$" /index.php?year=$1&month=$2 last; | |
| rewrite "^/([0-9]{4})/([0-9]{2})/page/([0-9]+)/*$" /index.php?year=$1&month=$2&cstart=$3 last; | |
| rewrite "^/([0-9]{4})/*$" /index.php?year=$1 last; | |
| rewrite "^/([0-9]{4})/page/([0-9]+)/*$" /index.php?year=$1&cstart=$2 last; | |
| rewrite "^/([^.]+)/page/([0-9]+)/*$" /index.php?do=cat&category=$1&cstart=$2 last; | 
| server { | |
| listen 80; | |
| server_name coderweb.ru; | |
| access_log /var/www/coderweb.ru/logs/access.log; | |
| error_log /var/www/coderweb.ru/logs/error.log; | |
| location / { | |
| uwsgi_pass unix:///var/tmp/coderweb.ru.sock; | |
| include uwsgi_params; | |
| } |