Skip to content

Instantly share code, notes, and snippets.

/*
These next two functions work together to lock down bbPress forums based on PMPro membership level.
Check that the current user has access to this forum. Be sure to update the $restricted_forums array based on your needs.
*/
function pmpro_check_forum()
{
global $current_user;
/*
@christopherlai
christopherlai / hack.sh
Created March 31, 2012 23:47 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@christopherlai
christopherlai / sdoc-all.rb
Created October 7, 2011 05:33 — forked from mrinterweb/sdoc-all.rb
sdoc all your installed gems
# with the help of the sdoc gem, this will generate the sdocs for all
# of your most recent gems.
# Caution! This will take a long time to run if you have a lot of gems installed.
# set an absolute path to the directory you would like your docs generated.
docs_path = "/Users/sean/tmp/docs/"
gems_output = `gem list --local`
gem_list = gems_output.gsub(/^([^ ]+).*\)/, '\1').split(/\n/)
latest_gem_dirs = gems_output.gsub(/^([^ ]+) \(([0-9\.]+).*\)/, '\1-\2').split(/\n/)