Skip to content

Instantly share code, notes, and snippets.

View afragen's full-sized avatar

Andy Fragen afragen

View GitHub Profile
@Rarst
Rarst / r-debug.php
Last active February 3, 2024 17:30
R Debug (set of dump helpers for debug)
<?php
/*
Plugin Name: R Debug
Description: Set of dump helpers for debug.
Author: Andrey "Rarst" Savchenko
Author URI: https://www.rarst.net/
License: MIT
*/
@jo-snips
jo-snips / events-conditional-wrappers.php
Last active December 21, 2023 12:27
The Events Calendar: Basic Conditional Wrappers
<?php
/*-----------------------------------------------------------------------------------*/
/* Conditional Logic to Detect Various Event Related Views/Pages
/*-----------------------------------------------------------------------------------*/
if( tribe_is_month() && !is_tax() ) { // Month View Page
echo 'were on the month view page';
} elseif( tribe_is_month() && is_tax() ) { // Month View Category Page
@afragen
afragen / deploy.sh
Created May 11, 2012 02:34
Git -> Subversion one-step deployment script
#! /bin/bash
# A modification of Dean Clatworthy's deploy script as found here: https://github.com/deanc/wordpress-plugin-git-svn
# The difference is that this script lives in the plugin's git repo & doesn't require an existing SVN repo.
# main config
PLUGINSLUG="the-events-calendar-pro-alarm"
CURRENTDIR=`pwd`
MAINFILE="the-events-calendar-pro-alarm.php" # this should be the name of your main php file in the wordpress plugin
# git config
@jo-snips
jo-snips / filter-ical-event-item.php
Created October 8, 2012 18:22
The Events Calendar: Filter iCal Event Item
function filter_ical_description($item, $eventPost) {
$description = preg_replace( "/[\n\t\r]/", ' ', strip_tags( strip_shortcodes( $eventPost->post_content ) ) );
$item[] = 'DESCRIPTION:' . str_replace( ',','\,', $description );
return $item;
}
add_filter('tribe_ical_feed_item','filter_ical_description', 10, 2);
@trepmal
trepmal / extra-registration-fields.php
Created December 22, 2012 05:45
Extra registration fields
<?php
add_action( 'register_form', 'additional_profile_fields' );
add_action( 'signup_extra_fields', 'additional_profile_fields' );
function additional_profile_fields() { ?>
<p>
<label><?php _e('First Name') ?><br />
<input type="text" name="first_name" id="first_name" class="input" size="25" /></label>
</p>
<p>
@aroemen
aroemen / restore-git-submodules.sh
Created February 25, 2013 02:39
Restore git submodules from .gitmodules. Since git submodule init only considers submodules that already are in the index (i.e. "staged") for initialization this short script parses .gitmodules, and each url and path pair.
#!/bin/sh
set -e
git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
while read path_key path
do
url_key=$(echo $path_key | sed 's/\.path/.url/')
url=$(git config -f .gitmodules --get "$url_key")
git submodule add $url $path
@ccstone
ccstone / BBEdit-TextWrangler_RegEx_Cheat_Sheet.txt
Last active March 30, 2024 07:53
BBEdit-TextWrangler Regular Expression Cheat-Sheet
————————————————————————————————————————————————————————————————————————————————————————————————————
BBEdit / BBEdit-Lite / TextWrangler Regular Expression Guide Modified: 2018/08/10 01:19
————————————————————————————————————————————————————————————————————————————————————————————————————
NOTES:
The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use.
Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete.
@bonny
bonny / plugin-stats.php
Last active December 16, 2015 07:59
WordPress Plugin Download Stats for Panic Status Board Original blog post: http://simple-fields.com/2013/status-board-panel-to-show-wordpress-plugin-downloads/
<?php
// Read the original blog post here to understand what this is:
// http://simple-fields.com/2013/status-board-panel-to-show-wordpress-plugin-downloads/
define('WP_USE_THEMES', false);
define("WP_CACHE", false); // i get 404 if enabled
require('../wordpress/wp-blog-header.php');
class panic_dashboard_wp_plugin_stats {
@thefuxia
thefuxia / t5-silent-flush.php
Last active August 11, 2016 11:03
T5 Silent Flush - Flushes rewrite rules whenever a custom post type or taxonomy is registered and not already part of these rules. This is a soft flush, the .htaccess will not be rewritten.
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: T5 Silent Flush
* Description: Flushes rewrite rules whenever a custom post type or taxonomy is registered and not already part of these rules. This is a soft flush, the .htaccess will not be rewritten.
* Version: 2013.05.04
* Author: Thomas Scholz <info@toscho.de>
* Author URI: http://toscho.de
* License: MIT
* License URI: http://www.opensource.org/licenses/mit-license.php
*/
anonymous
anonymous / Event Calendar Pro Responsive Solution
Created May 21, 2013 18:18
Event Calendar Pro Responsive Solution
@media only screen and (min-width : 320px) and (max-width : 480px) {
#tribe-events-event-meta .column {
float:left;
width:90%!important;
padding:0 4% 0 0;
text-align:left;
margin:0;
}