Skip to content

Instantly share code, notes, and snippets.

@jakubp
jakubp / gist:2881585
Created June 6, 2012 12:31
jQuery plugin to remove classes with given prefix
// Remove classes that have given prefix
// Example:
// You have an element with classes "apple juiceSmall juiceBig banana"
// You run:
// $elem.removeClassPrefix('juice');
// The resulting classes are "apple banana"
// NOTE: discussion of implementation techniques for this, including why simple RegExp with word boundaries isn't correct:
// http://stackoverflow.com/questions/57812/jquery-remove-all-classes-that-begin-with-a-certain-string#comment14232343_58533
@krogsgard
krogsgard / events-labels.php
Created June 22, 2012 16:03
Change The Events Calendar labels
<?php
add_filter( 'gettext', 'krogs_event_change_venue_name', 20, 3 );
/**
* Change comment form default field names.
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function krogs_event_change_venue_name( $translated_text, $text, $domain ) {
@jaredatch
jaredatch / global.js
Created June 29, 2012 03:38
Mobile Genesis menus
jQuery(document).ready(function($){
// Mobile navigation
$('#prim-selector, #sec-selector').change(function(){
if ($(this).val()!='') {
window.location.href=$(this).val();
}
});
});
(function($,sr){
// debouncing function from John Hann
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
var debounce = function (func, threshold, execAsap) {
var timeout;
return function debounced () {
var obj = this, args = arguments;
function delayed () {
@marcedwards
marcedwards / high-dpi-media.css
Last active November 19, 2023 12:56
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
<?php
/**
* Database emtpying and file removing class.
*
* Truncates all necessary tables in the defined database and removes
* any files uploaded by the demo user.
*
* @since 1.0.0
*
* @author Thomas Griffin
@twonjosh
twonjosh / Create iOS Icons.jsx
Last active April 25, 2023 08:41 — forked from ma11hew28/Create Icons.jsx
Photoshop Script to Create iOS Icons from a source image
// Photoshop Script to Create iPhone Icons from iTunesArtwork
//
// WARNING!!! In the rare case that there are name collisions, this script will
// overwrite (delete perminently) files in the same folder in which the selected
// iTunesArtwork file is located. Therefore, to be safe, before running the
// script, it's best to make sure the selected iTuensArtwork file is the only
// file in its containing folder.
//
// Copyright (c) 2010 Matt Di Pasquale
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com
@norcross
norcross / backend-page-query.php
Created September 11, 2012 14:11
Get pages inside CMB class
case 'page_select':
echo '<select name="', $field['id'], '" id="', $field['id'], '">';
$linked_items = get_posts(array(
'post_type' => array ('page',),
'post_status' => 'publish',
'posts_per_page' => -1,
'orderby' => 'modified',
'order' => 'DESC'
));
foreach ($linked_items as $linked_item) {
<?php
/*
Plugin Name: Unplugged Mobile Theme
Plugin URI: http://www.rachelbaker.me
Description: A plugin and theme for WordPress that automatically reformats your blog's content for optimized viewing on Apple's <a href="http://www.apple.com/unplugged/">unplugged</a> and <a href="http://www.apple.com/ipodtouch/">iPod touch</a>.
Author: Rachel Baker
Version: 0.1
Author URI: http://www.rachelbaker.me
# Special thanks to Imthiaz Rafiq and the wp-pda Plugin (http://imthi.com/wp-pda/) which this plugin is derived from.
@jdevalk
jdevalk / archive-speaking_event.php
Last active December 12, 2021 20:13
Genesis helper code for schema
<?php
add_filter( 'genesis_attr_content', 'yoast_schema_empty', 20 );
add_filter( 'genesis_attr_entry', 'yoast_schema_event', 20 );
add_filter( 'genesis_attr_entry-title', 'yoast_itemprop_name', 20 );
add_filter( 'genesis_attr_entry-content', 'yoast_itemprop_description', 20 );
add_filter( 'genesis_post_title_output', 'yoast_title_link_schema', 20 );
/**
* We'll use the post info output to add more meta data about the event.