Skip to content

Instantly share code, notes, and snippets.

View chrispian's full-sized avatar

Chrispian chrispian

View GitHub Profile
@chrispian
chrispian / .htaccess
Last active July 25, 2019 18:36
URL Rewrite for local WP Dev using Local by Flywheel
# Basic rules to redirect local uploads to the actual live domain.
# Just edit .htaccess in the app/public folder.
# Credit to Aubrey Portwood for the idea (https://github.com/aubreypwd)
RedirectMatch 301 ^/wp-content/uploads/(.*) https://DOMAIN/wp-content/uploads/$1
RedirectMatch 301 ^/wp-content/themes/THEMENAME/images/(.*) https://DOMAIN/wp-content/themes/THEMENAME/images/$1
SELECT COUNT(*) as Days, DATE_FORMAT( post_date_gmt, '%M %D, %Y' ) as pub_date FROM `wp_posts` where `post_status` = 'publish' AND post_type = 'post' GROUP BY pub_date;
@chrispian
chrispian / gravity-form-tweaks.php
Created January 28, 2019 23:54
Gravity Form Stripe Tweaks
add_filter( 'gform_stripe_customer_id', function ( $customer_id, $feed, $entry, $form ) {
if ( rgars( $feed, 'meta/transactionType' ) == 'product' && rgars( $feed, 'meta/feedName' ) == 'Auto Pay Feed' ) {
$customer_meta = array(
'metadata' => gf_stripe()->get_stripe_meta_data( $feed, $entry, $form ),
);
$customer = gf_stripe()->create_customer( $customer_meta, $feed, $entry, $form );
return $customer->id;
@chrispian
chrispian / yummy-ftp-org.php
Last active January 10, 2019 02:49
Organize Yummy FTP Bookmarks
<?php
/**
* Quick script to organize YummyFTP bookmarks into alphabetical sub folders
* Run this in whatever directory you want to organize.
*
* You can set the folders to be upper or lower case and it also does 0-9 for domains that start with numbers
* @package CHB\Tools\YummyFTPOrg
* @author Chrispian Burks <[email protected]>