Skip to content

Instantly share code, notes, and snippets.

View afragen's full-sized avatar

Andy Fragen afragen

View GitHub Profile
@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
@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>
@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);
@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 / 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
@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
*/