Skip to content

Instantly share code, notes, and snippets.

trepmal / change-network-admin-color-scheme.php
Last active December 10, 2018 21:08
Swap the Color Scheme between regular and Network admins. For WP3.8 (and beyond, probably)
View change-network-admin-color-scheme.php
// Plugin Name: Change Network Admin Color Scheme
if ( is_multisite() ) {
add_filter( 'style_loader_src', 'cnacs_intercept_admin_color', 10, 2 );
add_action( 'admin_color_scheme_picker', 'cnacs_network_admin_color_scheme_picker');
add_action( 'personal_options_update', 'cnacs_update_network_admin_option' );
add_action( 'edit_user_profile_update', 'cnacs_update_network_admin_option' );
chartjes / gist:6666003
Created September 23, 2013 02:51
Vim setup
View gist:6666003
I use Pathogen and have the following bundles installed:
~/.vim/bundle ᐅ ls -l
total 0
drwxr-xr-x 5 chartjes staff 170 1 May 22:53 closetag.vim
drwxr-xr-x 8 chartjes staff 272 1 May 22:54 ctrlp.vim
drwxr-xr-x 8 chartjes staff 272 1 May 22:54 nerdcommenter
drwxr-xr-x 6 chartjes staff 204 1 May 22:51 pb.vim
drwxr-xr-x 18 chartjes staff 612 1 May 22:54 powerline
drwxr-xr-x 8 chartjes staff 272 1 May 22:54 supertab
shanselman / gist:5422230
Last active September 28, 2023 05:10
Evil Blog Comment Spammer just exposed his template through some error and the whole thing showed up in my comments.
View gist:5422230
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It
is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as
you did, the {internet|net|web} will be {much more|a lot more}
useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch}
your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any?
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe.
Rarst / composer.json
Last active January 27, 2023 12:40
Test project for WordPress stack via Composer
View composer.json
"name" : "rarst/install-test",
"description" : "Test project for WordPress stack via Composer",
"authors" : [
"name" : "Andrey Savchenko",
"homepage": ""
"type" : "project",
Viper007Bond / whatissoslow.php
Last active July 18, 2023 10:54
WordPress: Times how long it takes each filter and action to run and displays results at the end of the page. Quick and dirty.
View whatissoslow.php
* This little class records how long it takes each WordPress action or filter
* to execute which gives a good indicator of what hooks are being slow.
* You can then debug those hooks to see what hooked functions are causing problems.
* This class does NOT time the core WordPress code that is being run between hooks.
* You could use similar code to this that doesn't have an end processor to do that.
scribu /
Created November 12, 2012 16:35
Ubuntu PHP Dev Setup
apt-get -y install nginx mysql-server php5-mysql php5-fpm
# extra php packages
apt-get -y install php5-cli php5-gd php5-curl php5-xdebug
# change user from www-data to scribu
sed -i 's/www-data/scribu/g' /etc/nginx/nginx.conf /etc/php5/fpm/pool.d/www.conf
markjaquith / gist:2653957
Created May 10, 2012 15:36
WordPress Fragment Caching convenience wrapper
View gist:2653957
$frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL
if ( !$frag->output() ) { // NOTE, testing for a return of false
// YOU CANNOT FORGET THIS. If you do, the site will break.
ziadoz /
Last active July 16, 2023 10:02
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.