Skip to content

Instantly share code, notes, and snippets.

View cklosowski's full-sized avatar

Chris Klosowski cklosowski

View GitHub Profile
@cklosowski
cklosowski / gist:a19111a48291cceff7de
Last active November 17, 2015 14:32
Dear Host gator...wtf
Wow, first off the fact that I had to search for how to cancel a plan with you, is beyond ridiculous.
You just need a delete or cancel button on the plan list...end of story.
Then I'm met with this form of 7 required fields, when all you really should need to
know is my plan I want to cancel. The rest of this form is just so you can justify
your burn rate.
I've been through this form before...you know what happened?
Yeah, you gave ma 403 error to me when trying to cancel.
Yep, you provide a bad user experience and it doesn't even work in the end.
@cklosowski
cklosowski / ssp-nginx.conf
Created November 11, 2015 15:40
Possible fix for Nginx and PHP-FPM with Seriously Simple Podcasting
location ~* ^/podcast-download/ {
try_files $uri $uri/
fastcgi_index /index.php;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
}
@cklosowski
cklosowski / woocommerce-fees-by-state.php
Created August 5, 2015 06:09
Add fees to the WooCommerce cart, based on the state chosen for shipping
<?php
/**
* Plugin Name: WooCommerce - Fees by State
* Plugin URI: https://filament-studios.com/
* Description: Add Fees to the cart based off the shipping state
* Version: 1.0
* Author: Filament Studios
* Author URI: https://filament-studios.com
* License: GPL-2.0+
*/
@cklosowski
cklosowski / after-reply-link.php
Created May 29, 2015 04:23
Quick hook into the Twenty Fifteen Reply to link
@cklosowski
cklosowski / .bash_profile
Last active August 29, 2015 14:19
Quick Command line alias to get a set of WordPress Salts for wp-config.php
# Add this to your .bashrc (linux) or .bash_profile (OS X)
alias getsalts="curl https://api.wordpress.org/secret-key/1.1/salt/"
# Changes to these files require closing and reopening a new terminal session to be recognized
@cklosowski
cklosowski / on_this_date.php
Last active August 29, 2015 14:19
Gives a shortcode of [on_this_date] to display posts from this day, in all years from a site.
<?php
/*
Plugin Name: On This Date
Plugin URI: https://kungfugrep.com/
Description: Gives a shortcode [on_this_date] to show posts from this day of the month in all years
Version: 0.1
Author: Chris Klosowski
Author URI: https://kungfugrep.com
License: GPLv2 or later
*/
@cklosowski
cklosowski / getrepo
Created April 15, 2015 16:29
Quickly checkout a repo from the EDD Org
#!/usr/bin/env bash
if [ $# -lt 2 ]; then
echo "usage: $0 <plugin/theme> <repo-slug>"
exit 1
fi
TYPE=$1"s"
REPO=$2
echo "Changing Directory to:"
#jetpack_summary_widget .hndle {
background: inherit !important;
color: inherit !important;
}
@cklosowski
cklosowski / edd-ck-commenter-has-purchased.php
Last active August 29, 2015 14:14
See if a commenter has purchased a given download ID
<?php
/*
* Plugin Name: Easy Digital Downloads - Commenter has purchased
* Description: Adds a 'Purchased' tag after a commenter who's purchased a download
* Author: Chris Klosowski
* Version: 1.0
*/
/**
* NOTE: This is currently not very performant. If an email address has a lot
@cklosowski
cklosowski / update-payment-test.php
Created October 7, 2014 04:23
Update Payment Test
<?php
public function test_update_payment_amount() {
$pre_update_total_earnings = get_option( 'edd_earnings_total' );
$pre_update_payment_amount = edd_sanitize_amount( edd_get_payment_amount( $this->_payment_id ) );
$payment_download = array(
'id' => $this->_post->ID,
'price_id' => '1',
'amount' => '100',
'quantity' => '1'