Skip to content

Instantly share code, notes, and snippets.

View userabuser's full-sized avatar
💭
What's good?

userabuser

💭
What's good?
View GitHub Profile
@Fabryz
Fabryz / package.json
Created April 25, 2012 21:35
Save all images contained in a website domain/paths
{
"name": "rakeup",
"version": "0.0.1",
"author": "Fabrizio Codello",
"engines": {
"node": "0.6.x"
},
"private": true,
"dependencies": {
"http-agent": "0.1.x",
@helgatheviking
helgatheviking / custom-post-type-archive-menu-links.php
Created May 4, 2012 17:41
Adds Custom Post Type archives to the WordPress-powered menus
<?php
/*
Plugin Name: Custom Post Type Archive Menu Links
Plugin URI: http://codeseekah.com/2012/03/01/custom-post-type-archives-in-wordpress-menus-2/
Description: Easily Add Custom Post Type Archives to the Nav Menus
Version: 1.0
Author: soulseekah
Author URI: http://codeseekah.com
License: GPL2
@kasparsd
kasparsd / custom-post-taxonomy-permalinks.php
Created June 13, 2012 15:47
Create permalink structure URLs for custom post types that include all parent terms from a custom taxonomy
<?php
/*
Term Archive Pages:
- http://example.com/recipes/dinner/
- http://example.com/recipes/breakfast,brunch/
Single Recipe Pages:
- http://example.com/recipes/dinner/soup-title/
@retgef
retgef / pug-bomb.php
Created June 24, 2012 07:46
Pug Bomb API Endpoint WordPress Plugin
<?php
/*
Plugin Name: Pug Bomb API Endpoint
Description: Adds an API endpoint at /api/pugs/$n_pugs
Version: 0.1
Author: Brian Fegter
Author URL: http://coderrr.com
*/
class Pugs_API_Endpoint{
@franz-josef-kaiser
franz-josef-kaiser / get_remote_plugin_header.php
Created June 29, 2012 20:03
Retrieve plugin header comment from GitHub hosted plugin file
<?php
/**
* Get version number from main remote file plugin header comment
*
* @param string $raw_url The path to the plugin @example http://raw.github.com/franz-josef-kaiser/example
* @param string $main_file The main plugin file containing the plugin header comment
* @return mixed string|bool $all_headers FALSE on failure, ARRAY w plugin header comment data on success
*/
public function get_remote_plugin_data( $raw_url, $main_file )
{
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@thefuxia
thefuxia / filter-test.php
Created August 24, 2012 23:31
T5 AJAX Search
add_filter( 't5_ajax_search_args', 'restrict_t5_search' );
function restrict_t5_search( $args )
{
$args['post_type'] = array ( 'post', 'domicile' );
#$args['cat'] = 47;
#$args['cat'] = 'php';
$args['category_name'] = 'php';
return $args;
}
@rjz
rjz / cs-jq-plugin-template.coffee
Created September 3, 2012 17:01
Coffeescript jQuery Plugin Class Template
# A class-based template for jQuery plugins in Coffeescript
#
# $('.target').myPlugin({ paramA: 'not-foo' });
# $('.target').myPlugin('myMethod', 'Hello, world');
#
# Check out Alan Hogan's original jQuery plugin template:
# https://github.com/alanhogan/Coffeescript-jQuery-Plugin-Template
#
(($, window) ->
@Mihailoff
Mihailoff / AnObj.php
Created September 11, 2012 18:17
PHP Anonymous Object
<?php
/**
* PHP Anonymous Object
*/
class AnObj
{
protected $methods = array();
public function __construct(array $options)
@franz-josef-kaiser
franz-josef-kaiser / current_admin_info.php
Created September 13, 2012 01:25
Collect & display data from current admin screens contextual hooks and from which hook on some globals are available.
MOVED TO A REPO NOW: https://github.com/franz-josef-kaiser/current-admin-info