Skip to content

Instantly share code, notes, and snippets.

View aaronjorbin's full-sized avatar

Aaron Jorbin aaronjorbin

View GitHub Profile
<?php
/*
Plugin name: Super LaFours
Description: Removes caps for actions that should take place in code, not in UI
Author: Aaron Jorbin
Author URI: http://aaron.jorb.in/
Version: 0.1
*/
function super_lafours_map_meta_cap($caps, $cap, $user_id, $args) {
<?php
/*
Plugin name: LaFours
Description: Removes caps for actions that should take place in code, not in UI
Author: Aaron Jorbin
Author URI: http://aaron.jorb.in/
Version: 0.1
*/
function lafours_map_meta_cap($caps, $cap, $user_id, $args) {
<?php
function jorbin_cap_lock($caps, $cap, $user_id, $args) {
$not_allow = array(
'update_plugins',
'delete_plugins',
'install_plugins',
'activate_plugins',
'edit_plugins',
'update_themes',
@aaronjorbin
aaronjorbin / jorbin_update.php
Created December 26, 2013 20:53
Example of an update routine for a plugin
<?php
/*
Plugin Name: update versioning
Description: Example of an update routine for a plugin
Author: Aaron Jorbin
Version: 0.1
Author URI: http://aaron.jorb.in
*/
@aaronjorbin
aaronjorbin / color-rotator.php
Created December 12, 2013 17:40
Change the WordPress Admin color scheme every time you login.
<?php
/*
Plugin Name: Color Rotator
Description: Change the color scheme every time you login
Author: Aaron Jorbin
Version: 1.0
Author URI: http://aaron.jorb.in/
License: GPLv2 or later
*/
<?php
// embed the javascript file that makes the AJAX request
wp_enqueue_script( 'my-ajax-request', plugin_dir_url( __FILE__ ) . 'js/ajax.js', array( 'jquery' ) );
// declare the URL to the file that handles the AJAX request (wp-admin/admin-ajax.php)
wp_localize_script( 'my-ajax-request', 'ajax_object', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
o wp-admin/js/about.js
o wp-admin/js/accordion.js
o wp-admin/js/color-picker.js
o wp-admin/js/comment.js
o wp-admin/js/common.js
o wp-admin/js/custom-background.js
o wp-admin/js/custom-header.js
o wp-admin/js/customize-controls.js
o wp-admin/js/dashboard.js
o wp-admin/js/edit-comments.js
@aaronjorbin
aaronjorbin / twitter.php
Created March 4, 2013 02:23
Parse a twitter archive csv to pull out the time stamps
<?php
date_default_timezone_set('America/New_York');
$file = $argv[1];
$all = '';
$tweets = '';
$retweets = '';
if (($handle = fopen($file, "r")) !== FALSE) {
while (($data = fgetcsv($handle, 0, ",")) !== FALSE) {
$str = strtotime($data[5])."\n";
$all .= $str;
@aaronjorbin
aaronjorbin / expectations.md
Created October 25, 2012 21:32
Expectations for speakers and organizers of WordCamps

Purpose

The purpose of this document is to start a discussion that leads to better expectations between speakers and organizers of WordCamps. It is based on Open Conference Expectations by @rmurphey @divya and @paul_irish. It is based on my experience speaking at many WordCamps and seeing some great things and not great things. I would love your comments and feedback.

What I ask for as a speaker

  1. A complimentary ticket to the event.
  2. A code of conduct for every attendee, including speakers and sponsors. Everyone should be able to have a good time in a safe, harassment-free environment. See the The Ada Initiative for more information on how to create such a policy.
  3. Adequate amount of time to prepare. This means the call for speakers should occur at least sixty days before the camp and invitations at least thirty days before the
@aaronjorbin
aaronjorbin / wcphilly-twitter.js
Created October 20, 2012 20:35
Get a list of all twitter handles at WordCamp Philly 2012
// Get Twitter accounts on the WC Philly 2012 site
var page = require('webpage').create(),
system = require('system');
// Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this")
page.onConsoleMessage = function(msg) {
console.log(msg);
};