Skip to content

Instantly share code, notes, and snippets.

View trepmal's full-sized avatar
🍪

Kailey Lampert trepmal

🍪
View GitHub Profile
@trepmal
trepmal / named-colors.php
Created May 29, 2012 17:33
Named HTML Colors
<?php
$namedcolors = array( 'AliceBlue', 'AntiqueWhite', 'Aqua', 'Aquamarine', 'Azure', 'Beige', 'Black', 'Blue', 'BlueViolet', 'Brass', 'BrightGold', 'Bronze', 'Brown', 'CadetBlue', 'Chocolate', 'Copper', 'Coral', 'Crimson', 'Cyan', 'DarkBlue', 'DarkBrown', 'DarkCyan', 'DarkGoldenRod', 'DarkGray', 'DarkGreen', 'DarkKhaki', 'DarkMagenta', 'DarkOliveGreen', 'DarkOrange', 'DarkOrchid', 'DarkPurple', 'DarkSalmon', 'DarkSlateBlue', 'DarkSlateGray', 'DarkTan', 'DarkTurquoise', 'DarkViolet', 'DarkWood', 'DimGray', 'DustyRose', 'FeldSpar', 'FireBrick', 'ForestGreen', 'Gold', 'GoldenRod', 'Gray', 'Green', 'GreenCopper', 'GreenYellow', 'HotPink', 'HunterGreen', 'IndianRed', 'Indigo', 'Ivory', 'Khaki', 'Lavender', 'LightBlue', 'LightCoral', 'LightCyan', 'LightGray', 'LightGreen', 'LightPink', 'LightSteelBlue', 'LightWood', 'Lime', 'LimeGreen', 'Magenta', 'MandarinOrange', 'Maroon', 'MediumAquaMarine', 'MediumBlue', 'MediumForestGreen', 'MediumGoldenRod', 'MediumOrchid', 'MediumSeaGreen', 'MediumSlateBlue', 'MediumSpri
@trepmal
trepmal / gist:2831344
Created May 29, 2012 23:07
Stand-alone WordPress.org plugin api access
<?php
// Stand-alone WordPress.org plugin api access
$url = 'http://api.wordpress.org/plugins/info/1.0/';
$fields = array(
'action' => 'query_plugins',
'request' => serialize( (object) array(
'author' => 'trepmal',
//'search' => 'howdy',
@trepmal
trepmal / user-meta-upload.php
Created June 1, 2012 20:32
User Meta Upload
<?php
/*
Plugin Name: User Meta Upload
Plugin URI: http://trepmal.com
Description: Add a file-upload form to the user edit profile page
Version: 0.1
Author: Kailey Lampert
Author URI: http://kaileylampert.com
Copyright (C) 2012 Kailey Lampert
@trepmal
trepmal / wporg-repo-plugins.php
Created June 2, 2012 04:56
WPORG Repo Plugins
<?php
/*
Plugin Name: WPORG Repo Plugins
Description: Widget to display plugins on the wordpress.org repository by author
Author: Kailey Lampert
Author URI: http://kaileylampert.com/
*/
add_action( 'widgets_init', 'register_wporg_repo_plugins' );
function register_wporg_repo_plugins() {
@trepmal
trepmal / include-page-widget.php
Created June 5, 2012 22:59
Include Page Widget
<?php
/*
Plugin Name: Include Page Widget
Plugin URI: http://trepmal.com/
Description: Widget. Display a page's content. That's it. Fork and adapt!
Version: 0.1
Author: Kailey Lampert
Author URI: http://kaileylampert.com
Copyright (C) 2012 Kailey Lampert
@trepmal
trepmal / notes.md
Last active January 6, 2021 02:10
[WordPress Plugin] Simple Registration/Invite Codes
  1. Assumes "Anyone can register" is checked on wp-admin/options-general.php
  2. Create a code by creating a post at wp-admin/edit.php?post_type=invite_codes with the code in the title
  3. When a user registers at wp-login.php?action=register, they must provide a valid code. Code validation is fully dependent on get_page_by_title, so there is some loose matching
  4. When a code is succuessfully used, the code "post" will be marked as 'draft', and post meta will be added indicating who used it.
  5. Disabling the wp_update_post section will allow codes to be reused until manually marked as 'draft'
@trepmal
trepmal / open-plugin-file-locally.php
Created June 8, 2012 18:14
Open Plugin File Locally
<?php
/*
Plugin Name: Open Plugin File Locally
Plugin URI: http://trepmal.com/
Description: Adds link to plugin list to open plugin files in their default desktop application. http://cl.ly/HFXW Requiments: Mac OSX, WP on localhost
Version: 0.1
Author: Kailey Lampert
Author URI: http://kaileylampert.com
Copyright (C) 2012 Kailey Lampert
@trepmal
trepmal / images-for-comment.php
Created June 21, 2012 03:03
Images for Comments
<?php
/*
Plugin Name: Images for Comments
Plugin URI: http://trepmal.com/
Description: Replaces plain textarea with one that has media uploader and formatting buttons
Version: 1
Author: Kailey Lampert
Author URI: http://kaileylampert.com
*/
@trepmal
trepmal / remote-login.php
Created June 21, 2012 20:49
[WordPress Plugin] Remote Login
<?php
/*
Plugin Name: Remote Login
Description: Log into the site with creds that work on remote site (as defined in plugin). The remote site must have XML-RPC enabled.
Author: Kailey Lampert
Author URI: http://kaileylampert.com/
THIS IS NOT COMPLETE - DO NOT USE IN PRODUCTION
The remote site (defined below in $server) is the "master" site.
<?php
//Plugin Name: Basic Google Analytics
new Basic_Google_Analytics();
class Basic_Google_Analytics {
function __construct( ) {
add_action( 'admin_init' , array( &$this , 'register_fields' ) );
add_action( 'init' , array( &$this , 'load_after' ) );
}