Skip to content

Instantly share code, notes, and snippets.

View jkudish's full-sized avatar

Joey Kudish jkudish

View GitHub Profile
#!/bin/bash
# args
MSG=${1-'deploy from git'}
BRANCH=${2-'trunk'}
# paths
SRC_DIR=$(git rev-parse --show-toplevel)
DIR_NAME=$(basename $SRC_DIR)
DEST_DIR=~/Sites/wp-plugins/$DIR_NAME/$BRANCH
@jkudish
jkudish / emailshortcode.php
Created December 7, 2012 17:52 — forked from robertdall/emailshortcode.php
Email Short Code
<?php
// Hide Email from Spam Bots
function cwc_mail_shortcode( $atts , $content = null ) {
if ( ! is_email( $content ) )
return;
for ( $i = 0; $i < strlen( $content ); $i++ )
$encodedmail .= "&#" . ord( $content[$i] ) . ';';
return '<a href="' . esc_url( 'mailto:' . $encodedmail ) . '">Email</a>';
@nickawalsh
nickawalsh / icons.sass
Last active October 7, 2021 09:38
Auto Hi-res Sprites
@import compass
$icons: sprite-map("icons/*.png")
$icons-hd: sprite-map("icons-hd/*.png")
i
background: $icons
display: inline-block
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi)
background: $icons-hd
@robertdall
robertdall / emailshortcode.php
Last active October 13, 2015 17:27
Email Short Code
// Hide Email from Spam Bots using antispam bot http://codex.wordpress.org/Function_Reference/antispambot
function HideMail($atts , $content = null ){
if ( ! is_email ($content) )
return;
return '<a href="mailto:'.antispambot($content).'">'.antispambot($content).'</a>';
}
add_shortcode( 'email','HideMail');
@nb
nb / bootstrap-sample.php
Created August 5, 2012 19:27
Sample plugin tests config files
<?php
define( 'WP_TESTS_PATH', '<Enter the path to your unit-tests checkout>' );
$GLOBALS['wp_tests_options'] = array(
'active_plugins' => array( '<plugindir/<plugin>.php' ),
);
require rtrim( WP_TESTS_PATH, DIRECTORY_SEPARATOR ) . DIRECTORY_SEPARATOR . 'bootstrap.php';
@gsdevme
gsdevme / ipv6-mysql.php
Created April 2, 2012 04:52
Shit for handling IPv6 & mysql storage
<?php
/**
* Shit for handling IPv6 & mysql storage, @gsphpdev
* Bloody headache... remember this Gavin!
*/
/**
* Only PHP 5.4+ has this function so need to add one if not
@jkudish
jkudish / tribe-settings.md
Created March 14, 2012 22:30
Documentation for the new TribeSettings API available in The Events Calendar 2.0.5

Tribe Settings API

This is documentation for the new TribeSettings API available in The Events Calendar 2.0.5 and up

There are four classes that make up the new Tribe Settings API. All four are located in the /lib folder of the plugin. All four are also bootstrapped and loaded whenever the plugin runs.

Take note that each class represents a level of abstraction. If you are creating a new settings tab, you will be mostly concerned and interested in the fourth class TribeSettingsTab which neatly wraps the other 3 classes into a helpful & easy to use API.

Class TribeSettings

@jkudish
jkudish / always-login.php
Created January 13, 2012 21:08
Always logged in with WordPress
<?php
/**
* keeps a user always logged in
* don't use this on a production site, ever!
*/
add_action('init', 'auto_login');
add_action('admin_init', 'auto_login');
function auto_login() {
@evansolomon
evansolomon / kissmetrics.php
Created December 3, 2011 23:11
Kissmetrics plugin for WordPress with a simplified class based on their default library
<?php
/*
Plugin Name: WP Kissmetrics
Description: Record events using Kissmetrics' PHP API. Intended to be used by developers only.
Author: evansolomon
Version: 1.0
*/
/* Forked from https://github.com/kissmetrics/KISSmetrics/blob/master/km.php */
@evansolomon
evansolomon / optimizely.php
Created October 10, 2011 17:37
WordPress.com plugin for running Optimizely experiments
<?php
/*
Plugin Name: Optimizely
Description: Runs Optimizely experiments.
Author: koop, evansolomon
Version: 0.2
*/
class WPCOM_Optimizely {
public $version;