Skip to content

Instantly share code, notes, and snippets.

Pippin Williamson pippinsplugins

Block or report user

Report or block pippinsplugins

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jaywilliams / csv_to_array.php
Created Apr 30, 2010
Convert a comma separated file into an associated array.
View csv_to_array.php
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
* Example:
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array
mvriel / pre-commit.php
Created May 16, 2011
Pre-commit hook for DocBlox
View pre-commit.php
echo PHP_EOL;
// output a little introduction
echo '>> Starting unit tests' . PHP_EOL;
// get the name for this project; probably the topmost folder name
$projectName = basename(getcwd());
ScottPhillips / .htaccess
Created Feb 2, 2012
Common .htaccess Redirects
View .htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php
#Redirect an entire site:
Redirect 301 /
#Redirect an entire site to a sub folder
Redirect 301 /
jeffsebring / gist:2025998
Created Mar 13, 2012 — forked from Viper007Bond/gist:2025993
Graphing car mileage
View gist:2025998
* All of this code is in a big class that implements things like meta boxes and
* tons of other stuff but for now here's the relevant functions.
* Note the custom post types and custom taxonomies are just in placeholder form.
* I haven't gone through and properly set the labels, etc. for them like I will
* when I release the plugin.
pippinsplugins / all_post_types.php
Created Apr 21, 2012
All Post Types in Search
View all_post_types.php
function ecpt_include_post_types_in_search($query) {
if(is_search()) {
$post_types = get_post_types(array('public' => true, 'exclude_from_search' => false), 'objects');
$searchable_types = array();
if($post_types) {
foreach( $post_types as $type) {
$searchable_types[] = $type->name;
joncave / endpoints.php
Created Jun 7, 2012
WP_Rewrite endpoints demo
View endpoints.php
Plugin Name: WP_Rewrite endpoints demo
Description: A plugin giving example usage of the WP_Rewrite endpoint API
Plugin URI:
Author: Jon Cave
Author URI:
function makeplugins_endpoints_add_endpoint() {
Adirael /
Created Aug 17, 2012
Fix wordpress file permissions
# This script configures WordPress file permissions based on recommendations
# from
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
kasparsd /
Last active May 20, 2020
Using Git with Subversion Mirroring for WordPress Plugin Development
benjaminprojas / divide_money_evenly.php
Last active Feb 10, 2019
Function to divide money (numbers with 2 decimal points) as evenly as possible between any given number of recipients
View divide_money_evenly.php
echo nl2br(print_r(divide_money_evenly((float)(string) 78.23, 3), true));
function divide_money_evenly($number, $divided_by, $numbers=array()) {
$total = 0;
for($i=1; $i<=$divided_by; $i++) {
if(abs($number - $total) != 0) {
$divided = $number / $divided_by;
if($divided < 1) {
$rounded = 0;
View gist:4475625
Plugin Name: Easy Digital Downloads - Variable Pricing License Activation Limits
Plugin URL:
Description: Limit the number of license activations permitted based on variable prices
Version: 1.0
Author: Pippin Williamson
Author URI:
Contributors: mordauk
You can’t perform that action at this time.