Skip to content

Instantly share code, notes, and snippets.

View chrisvanpatten's full-sized avatar

Chris Van Patten chrisvanpatten

View GitHub Profile
@chrisvanpatten
chrisvanpatten / opengraph.php
Created June 21, 2013 18:03
Quick OpenGraph/meta tags.
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@TwitterHandle">
<meta name="twitter:creator" content="@TwitterHandle">
<meta property="og:locale" content="en_US">
<meta property="og:site_name" content="<?php get_bloginfo('title'); ?>">
<?php if ( is_single() || is_page() ) : ?>
<meta property="og:title" content="<?php wp_title(''); ?>">
<meta property="og:url" content="<?php echo get_permalink(); ?>">
<meta property="og:image" content="<?php
@chrisvanpatten
chrisvanpatten / tax-emoji.php
Created July 10, 2013 17:33
Custom taxonomy mu-plugin
<?php
/*
Plugin Name: emoji Custom Taxonomy
Plugin URI: http://www.vanpattenmedia.com/
Description: Custom taxonomy registration
Author: Van Patten Media
Version: 1.0
Author URI: http://www.vanpattenmedia.com/
*/
@chrisvanpatten
chrisvanpatten / DEVELOPER.md
Last active December 23, 2015 20:19
Seeking a developer

Seeking a developer

Van Patten Media is seeking a contract-based PHP and WordPress freelancer to work with us on occasional projects.

You should be experienced with WordPress plugin and theme development as well as PHP frameworks such as Laravel, Symfony, etc. We want someone highly flexible, as our projects tend to vary. One project may involve building a simple WordPress plugin based on rough wireframes, another project could involve generating recommendations dynamically based on user data, or writing an API to a basic database.

A working understanding of Git is essential. You should be reliably accessible via email or our internal HipChat room, and be prepared to share daily updates while a project is in development. If you have design sensibilities (and Sass/CSS experience) that's awesome too.

Rate is negotiable.

Use this to extend Slim-Flash so you can display messages for the current request.

dataLayer.push({
'event': 'gaTriggerEvent',
'gaEventCategory': 'form',
'gaEventAction': 'submit',
'gaEventLabel': 'lead-gen'
});
@chrisvanpatten
chrisvanpatten / routing.php
Created June 15, 2016 12:30
An extension of the brain/cortex router which provides a slightly terser syntax when working with multiple method types at the same path
<?php
namespace MyNamespace;
use Brain\Cortex\Route\RouteCollectionInterface as Routes;
use Brain\Cortex\Route\QueryRoute;
class Routing
{
@chrisvanpatten
chrisvanpatten / routes.php
Last active June 16, 2016 10:12
Even more pared-down extension of brain/cortex. Makes registering new routes delightfully fast.
<?php
namespace MyProject;
use Brain\Cortex\Route\RouteCollectionInterface as CortexRoutes;
use Brain\Cortex\Route\QueryRoute;
class Routes
{
@chrisvanpatten
chrisvanpatten / nginx.conf
Created September 1, 2012 14:46
nginx proxy_pass uploads
location ~* \.(?:ico|gif|jpe?g|png)$ {
try_files $uri $uri/ @s3;
expires 8h;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
location @s3 {
expires 8h;
add_header Pragma public;
@chrisvanpatten
chrisvanpatten / custom-tinymce-0.php
Last active October 18, 2016 16:03
Register custom style formats to TinyMCE in WordPress
<?php
/**
* custom_tinymce
*/
function vpm_custom_tinymce( $settings ) {
// Define our custom formats
$style_formats = array(
array(
@chrisvanpatten
chrisvanpatten / cpt-show.php
Created May 3, 2013 17:57
Simple bit of code to register a custom post type. Use as an mu-plugin.
<?php
/*
Plugin Name: show Custom Post Type
Plugin URI: http://www.offbroadway.com/
Description: Custom post type for OffBroadway.com
Author: Van Patten Media
Version: 1.0
Author URI: http://www.vanpattenmedia.com/
*/