Skip to content

Instantly share code, notes, and snippets.

<?php
/*
Plugin Name: Manage Tags Capability
Description: This plugin adds a bit more functionality to the manage_categories capability. If a user cannot manage categories, then they will see a custom box for post tags that lists all existing post tags for selection but does not allow the user to add new post tags.
Version: 1.0
Author: B.J. Allen, Leia Scofield
Author URI: http://rd2inc.com
Requires: WordPress Version 2.6 or above
*/
alias ci="mvn clean install"
alias qi="mvn clean install -Dmaven.test.skip=true -Dfindbugs.skip=true"
alias cl="mvn clean"
alias junit="mvn clean compiler:compile compiler:testCompile resources:resources resources:testResources surefire:test"
alias jcover="mvn clean compiler:compile compiler:testCompile resources:resources resources:testResources cobertura:check -Dfindbugs.skip=true"
alert('the javascript embed feature is working');
@bjallen
bjallen / gist:2644347
Created May 9, 2012 13:05
arrow box css
<div class="arrow_box"><h1 class="logo">css arrow please!</h1></div>
.arrow_box {
position: relative;
background: #91cad5;
border: 1px solid #1bf5df;
}
.arrow_box:after, .arrow_box:before {
right: 100%;
border: solid transparent;
@bjallen
bjallen / gist:3060086
Created July 6, 2012 13:13
playing with overriding hash and equals
class Point
attr_accessor :lat, :lon, :title, :content
def initialize(lat, lon, title, content)
@lat = lat
@long = lon
@title = title
@content = content
end
@bjallen
bjallen / gist:3240161
Created August 2, 2012 20:00
delegate aliases
# code I found (i.e. not mine)
class Module
def metaclass(&block)
meta = class << self; self; end
meta.module_eval(&block) if block_given?
meta
end
def const_delegate(to,*methods)
@bjallen
bjallen / kalendae-icon-start-end.js
Created August 20, 2012 22:12
icon and start/end control for Kalendae
var DatePicker = (function($, Kalendae) {
var DatePicker = function(id, format) {
var $dateField = $('#' + id);
var $icon = $('<i class="cal"></i>');
$dateField.after($icon);
// the blurInProgress flag is needed to handle the various scenarios
// where the user focuses and blurs the dateField via keyboard or mouse
// and if it was the mouse, did they click on the icon or elsewhere
@bjallen
bjallen / gist:3723463
Created September 14, 2012 17:44
city impact on results
# see what the confidence code means here:
# http://www.mapquestapi.com/geocoding/geocodequality.html
Web::Address.from_params({ :street => "Canal Road", :city => "Orleans", :state => "MA", :country => "US" })
[{"country_name"=>"United States",
"city"=>"Orleans",
"@name"=>"location",
"latitude"=>41.796795,
"country"=>"US",
@bjallen
bjallen / vagrant-capistrano
Created September 29, 2012 13:24 — forked from fadhlirahim/vagrant-capistrano
Vagrant capistrano config bit
# Don't forget to run this vagrant command first
# vagrant ssh-config >> ~/.ssh/config
set :user, 'vagrant'
set :run_method, :sudo
role :app, '33.33.33.10'
ssh_options[:keys] = `vagrant ssh_config | grep IdentityFile`.split.last
@bjallen
bjallen / gist:3805617
Created September 30, 2012 01:51
multiple vagrant vm config
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.define :app do |app_config|
app_config.vm.customize ["modifyvm", :id, "--name", "app1", "--memory", "512"]
app_config.vm.box = "precise64_with_ruby_193"
app_config.vm.host_name = "app1"
app_config.vm.forward_port 22, 2222, :auto => true
app_config.vm.forward_port 80, 4567