Skip to content

Instantly share code, notes, and snippets.

View tatemz's full-sized avatar

Tate Barber tatemz

View GitHub Profile
<?php
class WCFAY_Plugin_Settings {
public function __construct() {
}
public function create_page() {
}
public function register_settings() {
@tatemz
tatemz / easy_transfer.sh
Last active August 29, 2015 14:01
This is an easy way to transfer files with wget via ftp protocol.
#!/bin/bash
wget -rv -nc --timeout=15 --random-wait password="SomeSecurePassword" ftp://username@domain.com/path/to/webdir/
@tatemz
tatemz / race-1.php
Last active August 29, 2015 14:02
A gist for showing how WordPress actions and filters can be used.
<?php
// The starting line
start();
// 26 mile markers
for ( $mile = 1; $mile <= 26; $mile++ ) {
if ( $mile == 13 ) // Halfway mark
halfway_mark();
@tatemz
tatemz / class-page-object.php
Created August 2, 2014 21:36
How to Optimize Your WordPress Metadata
<?php
class Page_Object {
public $ID;
public $original_post;
public $data = array();
public function __construct( $id ) {
<?php
if ( empty( $_POST['acf'] ) ) {
return;
}
if (
!isset( $_POST['acf']['field_543aee78c4176'] )
|| !isset( $_POST['acf']['field_543aee84c4177'] ) )
{
return;
@tatemz
tatemz / app.css
Last active August 29, 2015 14:15
An example how css-condense can optimize Foundation Apps (line breaks are turned on for better visual).
/* AUTOCOMPLETE */
.autocomplete{
width: 100%;
position: relative;
}
.autocomplete input{
font-size: 1.2em;
width: 100%;
<!-- /app/code/local/MyCompany/MyModule/etc/config.xml -->
<?xml version="1.0"?>
<config>
<adminhtml>
<layout>
<updates>
<mycompany_mymodule>
<file>mycompany/mytemplate.xml</file>
@tatemz
tatemz / cmb2-fields.php
Created November 8, 2015 19:48
Add "Other" option to allow for custom radio input with CMB2
<?php
if ( file_exists( dirname( __FILE__ ) . '/cmb2/init.php' ) ) {
require_once dirname( __FILE__ ) . '/cmb2/init.php';
} elseif ( file_exists( dirname( __FILE__ ) . '/CMB2/init.php' ) ) {
require_once dirname( __FILE__ ) . '/CMB2/init.php';
}
add_action( 'cmb2_admin_init', 'yourprefix_register_demo_metabox' );
/**
@tatemz
tatemz / functions.php
Last active December 19, 2017 20:38
Fixing W3 Total Cache CDN with Beaver Builder CSS media
<?php
// W3 Total Cache Integration with Beaver Builder
add_filter( 'fl_builder_render_css', __NAMESPACE__ . '\bb_plugin_cdn_url' );
function bb_plugin_cdn_url( $css ) {
// Based on wp-content/plugins/w3-total-cache/extensions/WordPressSEO.php
if ( class_exists( 'W3_Plugin_CdnCommon' ) ) {
$site_url = wp_upload_dir();
@tatemz
tatemz / HelloWorld.java
Last active July 6, 2016 19:06
A build system for sublime text using docker java containers. Edit to fit your own needs... Check out this page for more build variables http://docs.sublimetext.info/en/latest/reference/build_systems/configuration.html
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World");
}
}