Skip to content

Instantly share code, notes, and snippets.

View cklosowski's full-sized avatar

Chris Klosowski cklosowski

View GitHub Profile
@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 / .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 / after-reply-link.php
Created May 29, 2015 04:23
Quick hook into the Twenty Fifteen Reply to link
@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 / 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 / gist:4754835
Created February 11, 2013 14:50
Postmeta all the things!
<?php $meta_keys = get_post_meta( get_the_ID() ); ?>
<?php foreach( $meta_keys as $meta => $value ) : ?>
<?php if( ( '_' != $meta[0] ) && ( 'enclosure' != $meta ) ) : ?>
<span class="custom-meta"><strong><?php echo $meta; ?>:</strong> <?php echo $value[0]; ?></span>
<?php endif; ?>
<?php endforeach; ?>
@cklosowski
cklosowski / sublime_completion.php
Last active December 16, 2015 17:59
Tokenization file for PHP, just remove the functions: ck_generator_is_constant ck_generator_dump ck_generator_strip Generates both constants and functions. Put this somewhere in the web directory of your codebase (preferably 1 folder above the codebase) and provide the absolute path to the code as a query string parameter of 'path': (IE: http://…
<?php
$path = NULL;
if ( isset( $_GET['path'] ) ) {
$path = $_GET['path'];
}
// File types to search in
$extensions = array(
'php',
'inc',
@cklosowski
cklosowski / gist:5694193
Created June 2, 2013 17:15
Fix for Pinboard 1.0.8 JS errors
wp_register_script( 'jquery-migrate', get_template_directory_uri() . '/scripts/jquery-migrate.js', array( 'jquery' ), null );
@cklosowski
cklosowski / Preferences.sublime-settings
Created July 27, 2013 13:23
My Sublime Text 2 User Preferences File
// While you can edit this file, it's best to put your changes in
// "User/Preferences.sublime-settings", which overrides the settings in here.
//
// Settings may also be placed in file type specific options files, for
// example, in Packages/Python/Python.sublime-settings for python files.
{
// Sets the colors used within the text area
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
// Note that the font_face and font_size are overriden in the platform
@cklosowski
cklosowski / edd-subsections-example.php
Last active January 7, 2016 22:38
Using EDD 2.5 Setting Tab Subsections
<?php
/**
* Register our settings section
*
* @return array
*/
function ck_edd_settings_section( $sections ) {
// Note the array key here of 'ck-settings'
$sections['ck-settings'] = __( 'Example EDD Extension', 'example-edd-extension' );