Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:

Evan Mattson aaemnnosttv

:shipit:
View GitHub Profile
@aaemnnosttv
aaemnnosttv / pl2x-hook-map.php
Last active August 29, 2015 14:09
PL2X Hook Map
View pl2x-hook-map.php
pagelines_before_html
<html>
<head>
pagelines_head
wp_head
pagelines_head_last
</head>
<body>
pagelines_before_site
<div id="site">
@aaemnnosttv
aaemnnosttv / dev-debug-loader.php
Last active August 29, 2015 14:14
Dev Debug Loader
View dev-debug-loader.php
<?php
if ( file_exists( WPMU_PLUGIN_DIR . '/dev-debug/dev-debug.php' ) )
require_once ( WPMU_PLUGIN_DIR . '/dev-debug/dev-debug.php' );
@aaemnnosttv
aaemnnosttv / call-shortcode.php
Last active August 29, 2015 14:20
Call Shortcode
View call-shortcode.php
<?php
if ( ! function_exists('call_shortcode') ) :
/**
* Helper function for calling a shortcode directly
*
* Rather than `echo do_shortcode('[foo bar=the]')` ...
*
* echo call_shortcode('foo', ['bar' => 'the']);
@aaemnnosttv
aaemnnosttv / config.yml
Created August 21, 2015 08:58
wp-cli base config
View config.yml
require:
- vendor/autoload.php
@aaemnnosttv
aaemnnosttv / soft-disable-plugins.php
Created May 20, 2014 18:01
Soft Disable All WP Plugins
View soft-disable-plugins.php
<?php
/**
* Plugin Name: Soft disable all WP plugins
* Author: Evan Mattson (@aaemnnosttv)
* Description: Allows all plugins to be softly disabled and re-enabled using a single constant.
* Version: 1.0
*
* Usage: Install this under mu-plugins/, and define('SOFT_DISABLE_PLUGINS', true) to soft disable all plugins.
* Delete/comment-out the constant definition or set to false to restore all plugins to their previous active states.
*
@aaemnnosttv
aaemnnosttv / return.php
Created January 3, 2016 02:21
Simple value callback return generator
View return.php
<?php
if ( ! function_exists('__return') ) :
/**
* Simple return callback generator
*
* @param null $return
* @return Closure
*/
function __return($return = null) {
return function() use ($return) {
@aaemnnosttv
aaemnnosttv / aws-iam-s3-single-bucket-policy.json
Created February 12, 2016 19:57
AWS IAM S3 Single Bucket Policy Template (Full Access)
View aws-iam-s3-single-bucket-policy.json
{
"Statement": [
{
"Action": [
"s3:ListAllMyBuckets"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::*"
},
{
View keybase.md

Keybase proof

I hereby claim:

  • I am aaemnnosttv on github.
  • I am aaemnnosttv (https://keybase.io/aaemnnosttv) on keybase.
  • I have a public key ASDP8nGBRCckhApflbk_o4CWjs7CTtz4r5ZcLzP_jmSEvwo

To claim this, I am signing this object:

@aaemnnosttv
aaemnnosttv / my-solution.html
Created January 16, 2017 23:20
JavaScript 30 // #10 - Hold Shift to Check Multiple Checkboxes
View my-solution.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<style>
html {
@aaemnnosttv
aaemnnosttv / wp-offload-s3-config.php
Created March 24, 2017 12:02
Offload S3 Environment-Based Configuration
View wp-offload-s3-config.php
<?php
/**
* There are many possible ways to set this, but it can only be defined once.
*
* Using an environment variable by the same name
* define( 'WP_ENV', getenv( 'WP_ENV' ) );
*
* Matching the hostname
* define( 'WP_ENV', 'example.com' == $_SERVER['SERVER_NAME'] ? 'production' : 'staging' );
*/