Skip to content

Instantly share code, notes, and snippets.

View andypotanin's full-sized avatar
🇺🇲
Focusing

Andy Potanin andypotanin

🇺🇲
Focusing
View GitHub Profile
@andypotanin
andypotanin / .monitrc
Last active December 11, 2015 23:19
monit -c /etc/monit/monitrc
# /etc/monit/conf.d/
check process hhvm with pidfile /var/run/hhvm/hhvm.pid
start program = "/etc/init.d/hhvm start" as uid "hhvm" and gid "hhvm" with timeout 60 seconds
stop program = "/etc/init.d/hhvm stop"
if failed host discodonniepresents.com port 80 protocol http
and request "/wp-login.php"
then restart
group server

Required

  • Theme must contain a changes.md file which explains, for humans, what was changed during a particular iteration.
  • All work must be submitted to GitHub, this is necessary for our CI services to analyze code quality.
  • There should be absolutely no inline JavaScript or CSS.
  • Must use template parts.
  • Header and footer templates should NOT wrap the inner conent. Example http://jsfiddle.net/andypotanin/pfarsqc8/
  • IDs should not be used at all, only properly namespaced classes.
  • Individual content parts and templates should identify themselves with a data-template attribute that defines the path/name of the template being used.
  • Scripts/Styles must be enqueued properly.
  • WordPress menus should be used for things like Social Media icon lists.
<?php
add_action( 'headers_sent', function() {
header( 'PageSpeed: on' );
header( 'PageSpeedDisableFilters:inline_css' );
header( 'PageSpeedLowercaseHtmlNames:on' );
header( 'PageSpeedFilters:collapse_whitespace,combine_css,rewrite_javascript' );
header( 'PageSpeedXHeaderValue:PageSpeed!' );
## Common Linux utilities for Ubuntu machines.
##
## curl https://gist.githubusercontent.com/andypotanin/54238c5d0f439e781215/raw/ > /etc/profile.d/bash.utils.sh
##
## - There should not be any "sudo" commands here since this is used by all users.
##
## @v1.1.3
if [[ -e /etc/environment ]]; then
source /etc/environment
@andypotanin
andypotanin / haproxy-for-mamp.cfg
Created November 23, 2014 22:37
Basic HAProxy configuration to proxy requests to MAMP running on port 82.
global
log 127.0.0.1 local0 notice
maxconn 2000
defaults
timeout connect 5000
timeout client 10000
timeout server 10000
listen localhost 0.0.0.0:80
---
name:
url:
attendee: A person or organization attending the event.
duration: The duration of the item (movie, audio recording, event, etc.) in ISO 8601 date format.
location:
- name: ..
- address: ..
artists:
{
"ok": true
}
################
## curl --silent https://gist.githubusercontent.com/andypotanin/e3db79c92f911d040c16/raw/git-subtree-helper.sh > /etc/profile.d/git-subtree-helper.sh
## chmod +x /etc/profile.d/git-subtree-helper.sh
## source /etc/profile.d/git-subtree-helper.sh
##
##
## /usr/local/git/bin
##
################
@andypotanin
andypotanin / ddp-veneer-shim.php
Last active August 29, 2015 14:08
Add to mu-plugins to override broken wp-veneer login/admin rewrites.
ob_start(function( $buffer ) {
$buffer = str_replace( '/wp-login.php', '/manage/login', $buffer );
$buffer = str_replace( '/wp-admin/', '/manage/', $buffer );
return $buffer;
});
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*)$ /secure.php?path=$1 [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
</IfModule>