Skip to content

Instantly share code, notes, and snippets.

View chrisvanpatten's full-sized avatar

Chris Van Patten chrisvanpatten

View GitHub Profile
@ianmjones
ianmjones / build-as3cf-aws2.sh
Last active June 15, 2023 18:37
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
fi
for PROG in composer find sed
@mcfarlan
mcfarlan / look-up-woo-deprecation.sh
Last active September 28, 2017 17:13
Looks for deprecated WooCommerce filters (v3.x.x)
#!/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 November 5, 2020 15:11
An mu-plugin that forces selected plugins to be active, without the capability to deactivate.
<?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 February 13, 2024 19:03
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)
<?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
Last active November 16, 2022 18:09
WP-CLI methods to iterate over any number of posts efficiently and reliably
<?php
// DEPRECATED. See https://github.com/alleyinteractive/wp-bulk-task as the successor to this trait.
/**
* 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 ) {
@CharlieHawker
CharlieHawker / gulp-favicons.js
Last active January 15, 2019 21:13
Generate favicons for common sizes automatically from an SVG file using gulp
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*')
@Vestride
Vestride / encoding-video.md
Last active March 12, 2024 16:41
Encoding video for the web

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 August 12, 2022 16:15
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
theMikeD / image_meta.php
Created January 20, 2015 17:43
Manipulates the metadata for uploaded images at upload time to make better use of IPTC data that may be present.
<?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: