Skip to content

Instantly share code, notes, and snippets.

@defunkt
defunkt / clients.md
Created April 18, 2010 14:09
A list of Gist clients.

Gist Clients

Want to create a Gist from your editor, the command line, or the Services menu? Here's how.

Editor Support

@franz-josef-kaiser
franz-josef-kaiser / upgdate.php
Created March 15, 2011 19:25
Update/Upgrade class for WordPress plugins in repos outside wp.org (Original Class: March 8, 2011 by Ronald Huereca)
<?php
//Plugin Upgrade Class
if ( !class_exists( 'PluginUpgrade' ) )
{
class PluginUpgrade
{
private $plugin_url = false;
private $remote_url = false;
@stefanfoulis
stefanfoulis / findauthors.sh
Created April 8, 2011 12:37
How to sync svn to git
#!/usr/bin/env bash
# Run this script inside a SVN checkout of the project
authors=$(svn log -q | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq)
for author in ${authors}; do
echo "${author} = NAME <USER@DOMAIN>";
@retgef
retgef / wysiwyg-meta-box.php
Created September 10, 2011 02:06
How to add a Wordpress WYSIWYG editor to a meta box.
<?php
define('WYSIWYG_META_BOX_ID', 'my-editor');
define('WYSIWYG_EDITOR_ID', 'myeditor'); //Important for CSS that this is different
define('WYSIWYG_META_KEY', 'extra-content');
add_action('admin_init', 'wysiwyg_register_meta_box');
function wysiwyg_register_meta_box(){
add_meta_box(WYSIWYG_META_BOX_ID, __('WYSIWYG Meta Box', 'wysiwyg'), 'wysiwyg_render_meta_box', 'post');
}
@mattwiebe
mattwiebe / responsive-images.php
Created September 21, 2011 23:02
Mobile First Responsive Images for WordPress
<?php
/*
Plugin Name: Mobile First Responsive Images
Description: Serve up smaller images to smaller screens.
Version: 0.1.1
Author: Matt Wiebe
Author URI: http://somadesign.ca/
*/
/**
@markjaquith
markjaquith / moderation-buddy.php
Created January 17, 2012 10:12
Moderation Buddy
<?php
/*
Plugin Name: Moderation Buddy
Description: A friendly assistent to make sure you don't get behind on your comment moderation tasks.
Version: 0.1
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
class CWS_Moderation_Buddy_Plugin {
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@GaryJones
GaryJones / functions.php
Created February 7, 2012 01:36
Add pinterest link after each post, only on singles.
<?php
add_action( 'genesis_post_content', 'child_add_pinterest_link', 15 );
/**
* Add pinterest link after post.
*
* Conditionally limited to single post. Remove the first conditional
* to make it show up on archive pages too.
*
* @since 1.0.0
@GaryJones
GaryJones / functions.php
Created February 12, 2012 04:01 — forked from billerickson/functions.php
Genesis Grid Loop Advanced
<?php
/**
* Possibly amend the loop.
*
* Specify the conditions under which the grid loop should be used.
*
* @author Bill Erickson
* @author Gary Jones
* @link http://code.garyjones.co.uk/genesis-grid-loop-advanced/
@benhuson
benhuson / Post_Taxonomy_Columns_And_Filter
Created February 17, 2012 11:21
Framework for adding taxonomy filter and column to WordPress manage post admin pages.
<?php
class Post_Taxonomy_Columns_And_Filter {
/**
* Constructor
*/
function Post_Taxonomy_Columns_And_Filter() {
add_filter( 'manage_edit-mycustomposttype_columns', array( $this, 'manage_mycustomposttype_columns' ) );
add_action( 'manage_mycustomposttype_posts_custom_column', array( $this, 'show_mycustomposttype_columns' ) );