Skip to content

Instantly share code, notes, and snippets.

View trepmal's full-sized avatar
🍪

Kailey Lampert trepmal

🍪
View GitHub Profile
@trepmal
trepmal / robohash-avatar.php
Created July 8, 2011 19:08
RoboHash Avatar
<?php
/*
Plugin Name: RoboHash Avatar
Plugin URI: http://trepmal.com/
Description: Robohash characters as default avatars
Author: Kailey Lampert
Version: 0.1
Author URI: http://kaileylampert.com/
*/
/*
@trepmal
trepmal / xkcd-timer.php
Created August 19, 2011 19:06
XKCD Timer WordPress Widget
<?php
/*
Plugin Name: XKCD Timer
Plugin URI:
Description: Pointless timer inspired by http://xkcd.com/363/ (forked from http://wordpress.org/extend/plugins/wp-timer/) Screenshot: http://screencast.com/t/V5JeD4GQot
Version: 1
Author: Kailey Lampert
Author URI: http://kaileylampert.com
Copyright (C) 2011 Kailey Lampert
@trepmal
trepmal / comment-overload.js
Created September 8, 2011 00:24
Comment Overload (WordPress plugin)
jQuery(document).ready( function($) {
$('#comment').keyup( function( event ) {
if (event.keyCode == '13') {
content = $(this).val();
content = content.replace("\n\n", "\n");
content = content.split("\n");
total = content.length - 1;
@trepmal
trepmal / editor_plugin.js
Created October 3, 2011 23:17
WordPress: TinyMCE button that wraps selection in given tag
// http://tinymce.moxiecode.com/wiki.php/API3:class.tinymce.Plugin
(function() {
tinymce.create('tinymce.plugins.WRAP', {
/**
* Initializes the plugin, this will be executed after the plugin has been created.
* This call is done before the editor instance has finished its initialization so use the onInit event
* of the editor instance to intercept that event.
*
@trepmal
trepmal / qtags.php
Created October 28, 2011 23:36
Quicktags API Test
<?php
/*
Plugin Name: Quicktags API Test
Description: Testing a few different kinds of Quicktags buttons
Author: Kailey Lampert
Author URI: http://kaileylampert.com/
*/
@trepmal
trepmal / scroll-to-top-admin-bar.php
Created November 15, 2011 00:46
WordPress - Scroll-To-Top Admin Bar
<?php
/*
Plugin Name: Scroll-To-Top Admin Bar
Description: Click anywhere on the Admin Bar that doesn't have a predefined purpose (links, input), and it'll scroll you to the top
Author: Kailey Lampert
Author URI: http://kaileylampert.com
*/
add_action( 'wp_head', 'add_jq' );
add_action( 'admin_head', 'add_jq' );
@trepmal
trepmal / notepad.js
Created November 16, 2011 21:35
WordPress: Front-end editable notepad
jQuery(document).ready(function($) {
$('#notepad').click(function(e) {
tag = e.target.tagName;
if ( tag != 'TEXTAREA' && tag != 'INPUT' ) {
contents = $(this).html();
$(this).html( '<textarea style="display:block;width:98%;height:100px;">' + contents + '</textarea><input type="submit" class="save" style="position:relative;z-index:99" />' );
}
});
$('#notepad input.save').live( 'click', function() {
@trepmal
trepmal / lists.php
Created December 6, 2011 06:07
WordPress: Testing bulleted and numbered lists
<?php
//Plugin Name: Bulleted Lists
new Bulleted_List();
class Bulleted_List {
function __construct() {
@trepmal
trepmal / pw-at-signup.php
Created December 20, 2011 21:58
WordPress: Choose password at registration (Multisite)
<?php
//Plugin Name: Choose password at registration (Multisite)
//Description: Doesn't change the confirmation screen or email
add_action('signup_extra_fields', 'ask_for_password');
function ask_for_password( $errors ) {
if ( $errmsg = $errors->get_error_message('bad_password') ) {
echo '<p class="error">'.$errmsg.'</p>';
}
@trepmal
trepmal / no-sticky.php
Created December 22, 2011 06:43
WordPress: No Front-Page Sticky Posts
<?php
//Plugin Name: No Front-Page Sticky Posts
//Description: Disables sticky posts on the front page (main blog page)
/*
upload this file to wp-content/mu-plugins
it'll automatically run, no need for activation
if multisite, it will run for *all* sites