Skip to content

Instantly share code, notes, and snippets.

View topdown's full-sized avatar
🎯
Focusing

Jeff Behnke topdown

🎯
Focusing
View GitHub Profile
<?php
/**
* Abstract class which has helper functions to get data from the database
*/
abstract class Base_Custom_Data
{
/**
* The current table name
*
* @var boolean
@topdown
topdown / BrightCove Analytics JS API
Created June 11, 2014 17:42
BrightCove Analytics JS API required player params
FIND
<param name="dynamicStreaming" value="true" />
AFTER ADD
<param name="includeAPI" value="true" />
<param name="templateLoadHandler" value="BCL.onTemplateLoaded" />
<param name="templateReadyHandler" value="BCL.onTemplateReady" />
Which should be before
<param name="@videoPlayer" value="some_video_id" / >
@topdown
topdown / vw_block_open_sans.php
Last active August 29, 2015 14:02
WordPress - Blocks Admin Panel from loading Google Fonts - Open Sans, mainly for work offline. I hate the lag when there is no internet.
<?php
/**
* Blocks Admin Panel from loading Google Fonts - Open Sans, mainly for work offline. I hate the lag when there is no internet.
*
* Created 6/21/14, 12:57 PM
*
* @category WordPress Plugin
* @package Block External Scripts - block_external_scripts.php
* @author Jeff Behnke <code@validwebs.com>
@topdown
topdown / wp-get-results.php
Created May 28, 2015 21:56
WP $wpdb->get_results() Gotcha
// Breaks ORDER BY silently
$sql = $this->wpdb->prepare( "SELECT * FROM $this->table ORDER BY 'id' ASC LIMIT %d OFFSET %d", $limit, $start );
// Works correctly
$sql = $this->wpdb->prepare( "SELECT * FROM $this->table ORDER BY id ASC LIMIT %d OFFSET %d", $limit, $start );
$rows = $this->wpdb->get_results( $sql );
return $rows;
@topdown
topdown / provision.sh
Created December 3, 2015 05:08 — forked from FrankM1/provision.sh
Faster provisioning for vvv - Removed provisioning for Wordpress Core development. That took a long time to complete
#!/bin/bash
#
# provision.sh
#
# This file is specified in Vagrantfile and is loaded by Vagrant as the primary
# provisioning script whenever the commands `vagrant up`, `vagrant provision`,
# or `vagrant reload` are used. It provides all of the default packages and
# configurations included with Varying Vagrant Vagrants.
# By storing the date now, we can calculate the duration of provisioning at the
@topdown
topdown / gist:8d895976b40b888942ba
Created January 19, 2016 02:59
Brew Update issues untracked working tree
cd $(brew --repository)
sudo chown -R $USER .
git reset --hard origin/master
brew update
@topdown
topdown / custom-post_status.php
Last active January 31, 2016 18:06
Custom post status workaround
<?php
/**
* Register Custom Status
*
*/
function custom_archived_post_status() {
$args = array(
@topdown
topdown / Gruntfile.js
Last active April 10, 2016 20:21
Network wide WordPress theme development
// http://mattbanks.me/grunt-wordpress-development-deployments/
// https://github.com/mattbanks/WordPress-Starter-Theme/blob/master/Gruntfile.js
'use strict';
module.exports = function (grunt) {
// load all grunt tasks matching the `grunt-*` pattern
require('load-grunt-tasks')(grunt);
var $proxy = 'vvv_domain.dev';
@topdown
topdown / fix-commands.sh
Last active June 6, 2016 14:47
VVV Issues
# Not saying this is a fix all, but this is what I had to do to get VVV running properly on my system.
# It failed to install properly do to script errors
# Branch master
# head 7f5411455573bba88d8ce232db957c62b11977f5
# VVV Update issues
vagrant ssh
su
#pass