Skip to content

Instantly share code, notes, and snippets.

View zooks's full-sized avatar

zooks zooks

View GitHub Profile
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDH$
ssl_prefer_server_ciphers on;
@zooks
zooks / inline.php
Created February 10, 2017 17:39
inline CSS snippet for MODX Revolution
<?php
// [[!inline?&file=`css/critical.css`]]
$assetsPath = $modx->getOption('assets_path');
$file = !empty($file) ? $file : $modx->getOption('file', $scriptProperties, '');
$myfile = fopen($assetsPath . $file, "r");
if (!$myfile){ return "";}
$inlneCSS = "";
while(!feof($myfile)) {
@zooks
zooks / inline-modx.html
Created April 21, 2017 23:58
Inline CSS with MODX Revolution
<link rel="canonical" href="[[~[[*id]]? &scheme=`full`]]" />
[[!MinifyXCustom?
&minifyJs=`1`
&minifyCss=`1`
&jsFilename=`mysite`
&cssFilename=`mysite`
&jsPlaceholder=`mysite.javascript`
&cssPlaceholder=`inline.css`
&cssSources=`
assets/css/style.css,
@zooks
zooks / nginx.example.com.conf
Created May 26, 2017 08:00
WordPress nginx.conf
location /blog/ {
try_files $uri $uri/ /blog/index.php?$args;
error_page 404 /404.html;
}
location ~* "/*\.(conf)$" {
deny all;
return 404;
}
@zooks
zooks / config.inc.php
Created May 26, 2017 19:38
phpMyAdmin config for VestaCP
<?
/* Optional: Advanced phpMyAdmin features */
$cfg['Servers'][$i]['pmadb'] = $dbname;
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['history'] = 'pma__history';
@zooks
zooks / .htaccess
Created June 5, 2017 18:48
Close access to the file extensions
<FilesMatch "^.*\.(?:pug|jade|cfg|config)$">
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</FilesMatch>
@zooks
zooks / search.html
Last active June 11, 2017 20:12
MODX search
# Solve Russian code page problem:
# http://www.yotadom.com/revo-poisk-po-sajtu-simplesearch-modx.html
[[!SimpleSearchForm? &searchIndex=`s`]]
[[!SimpleSearch? &searchIndex=`s`]]
@zooks
zooks / nginx.conf
Created July 9, 2017 21:27
nginx folder 301 redirect
location ~ ^/articles/(.*) {
return 301 /blog/$1;
}
@zooks
zooks / robots.txt
Created July 17, 2017 09:54
robots-closed.txt
# Closed for crawlers
User-agent: *
Disallow: /
@zooks
zooks / layout.html
Created July 21, 2017 10:18
October CMS Layout
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>October CMS - {{ this.page.title }}</title>
<meta name="description" content="{{ this.page.meta_description }}">
<meta name="title" content="{{ this.page.meta_title }}">
<meta name="author" content="OctoberCMS">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="OctoberCMS">