Skip to content

Instantly share code, notes, and snippets.

View chrisvanpatten's full-sized avatar

Chris Van Patten chrisvanpatten

View GitHub Profile
@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 / wpframe-bootstrap.sh
Last active October 13, 2015 12:58
wpframe Bootstrap Script
#! /bin/bash
# wpframe Bootstrap Script
# This is really only a proof of concept. There are likely a lot of
# improvements that could be made to streamline this and accomplish
# things in fewer/faster steps.
#
# Please READ THE SCRIPT before you run it. I'm not responsible if
# you break something. Report any bugs and suggest improvements,
# please!
#
@chrisvanpatten
chrisvanpatten / _fonts.scss
Last active December 10, 2015 17:39
Fonts
/*
* Using Sass's @each loop to automatically generate code for web fonts
*/
$fonts: (vpm, font-awesome);
@each $font in $fonts {
@include font-face( $font,
font-files(
'#{$font}/#{$font}.woff',
@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/
*/
@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.

<?php
/**
* Product quantity inputs
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.1.0
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
<?php
/**
* Product quantity inputs
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.1.0
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
<?php
/**
* vpm_comments_template
*
* Load our own template file for WooCommerce reviews
*/
function vpm_comments_template( $template ) {
global $woocommerce;
$comments_template_path = get_stylesheet_directory() . '/woocommerce/single-product-reviews.php';