Skip to content

Instantly share code, notes, and snippets.


Chris Van Patten chrisvanpatten

View GitHub Profile
ianmjones /
Last active Mar 10, 2020
A script for downloading the AWS PHP SDK v2, stripping down to S3 functionality and then applying a custom namespace.
#!/usr/bin/env bash
set -e
if [ ! -d src/amazon-s3-and-cloudfront ]; then
echo 'This script must be run from the repository root.'
exit 1
for PROG in composer find sed
mcfarlan /
Last active Sep 28, 2017
Looks for deprecated WooCommerce filters (v3.x.x)
jbrinley / force-plugin-activation.php
Last active Sep 19, 2018
An mu-plugin that forces selected plugins to be active, without the capability to deactivate.
View force-plugin-activation.php
Plugin Name: Force Plugin Activation/Deactivation (except if WP_DEBUG is on)
Plugin URI:
Description: Make sure the required plugins are always active.
Version: 1.0
Author: Modern Tribe, Inc.
Author URI:
tripflex / functions.php
Last active Jun 14, 2020
WordPress Remove Filter (remove_filter converted to remove_class_filter) to remove Filter/Action without Class Object access. Works with WordPress 1.2+ (4.7+ support added 9-19-2016)
View functions.php
* Make sure the function does not exist before defining it
if( ! function_exists( 'remove_class_filter' ) ){
* Remove Class Filter Without Access to Class Object
* In order to use the core WordPress remove_filter() on a filter added with the callback
mboynes / trait-alley-cli-bulk-task.php
Created Mar 24, 2016
WP-CLI methods to iterate over any number of posts efficiently and reliably
View trait-alley-cli-bulk-task.php
* Chunk up the task when you need to iterate over many posts.
* For instance, to iterate over every post on the site and add post meta:
* $this->bulk_task( function( $post ) {
* update_post_meta( $post->ID, 'some_meta', 'some value' );
* } );
CharlieHawker / gulp-favicons.js
Last active Jan 15, 2019
Generate favicons for common sizes automatically from an SVG file using gulp
View gulp-favicons.js
var gulp = require('gulp'),
imagemin = require('gulp-imagemin'),
notify = require('gulp-notify'),
plumber = require('gulp-plumber'),
rename = require('gulp-rename'),
rimraf = require('gulp-rimraf'),
imageResize = require('gulp-image-resize');
gulp.task('clean:favicons', function() {
return gulp.src('dist/favicon*')
View React Native Webview External Links
Vestride /
Last active Aug 11, 2020
Encoding video for the web

Encoding Video


Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
moonmilk /
Last active Feb 12, 2020
trying to figure out useful info for running python on dreamhost shared hosting - intended for twitter bot makers

python for botmakers, on dreamhost shared hosting

On a shared hosting service like dreamhost, how do you get your twitter bot up and running? Problems:

  • where should I put my script?
  • you can't install python modules like tweepy (for twitter access) because you don't have root permission
  • once you get that solved, how do you run your script? cron?

I'm still figuring this stuff out myself, so nothing is clear as it should be. Hope this page will be a resource that will improve over time.

theMikeD / image_meta.php
Created Jan 20, 2015
Manipulates the metadata for uploaded images at upload time to make better use of IPTC data that may be present.
View image_meta.php
Manipulates the metadata for uploaded images at upload time to make better use
of IPTC data that may be present.
An image is stored as an attachment, which is a special type of post. It is
handled the same way as any other post type.
As far as the meta goes, it's stored like this:
You can’t perform that action at this time.