Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Van Patten chrisvanpatten

View GitHub Profile
@ianmjones
ianmjones / build-as3cf-aws2.sh
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.
View build-as3cf-aws2.sh
#!/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
fi
for PROG in composer find sed
@mcfarlan
mcfarlan / look-up-woo-deprecation.sh
Last active Sep 28, 2017
Looks for deprecated WooCommerce filters (v3.x.x)
View look-up-woo-deprecation.sh
#!/bin/bash
FUNCTIONS="
woocommerce_email_order_schema_markup,
add_to_cart_fragments,
add_to_cart_redirect,
woocommerce_product_width,
woocommerce_product_height,
woocommerce_product_length,
woocommerce_product_weight,
@jbrinley
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
<?php
/*
Plugin Name: Force Plugin Activation/Deactivation (except if WP_DEBUG is on)
Plugin URI: http://tri.be/
Description: Make sure the required plugins are always active.
Version: 1.0
Author: Modern Tribe, Inc.
Author URI: http://tri.be/
*/
@tripflex
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
<?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
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
<?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
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
Vestride / encoding-video.md
Last active Aug 11, 2020
Encoding video for the web
View encoding-video.md

Encoding Video

Installing

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
moonmilk / dreamhostpython.md
Last active Feb 12, 2020
trying to figure out useful info for running python on dreamhost shared hosting - intended for twitter bot makers
View dreamhostpython.md

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
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
<?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.