Skip to content

Instantly share code, notes, and snippets.

View zooks's full-sized avatar

zooks zooks

View GitHub Profile
@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 / 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 / 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 / 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 / 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)) {
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDH$
ssl_prefer_server_ciphers on;