A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
| <?php | |
| add_filter('wp_butler_ajax_keyword_actions', 'wp_butler_switch_plugins_action', 10, 2); | |
| function wp_butler_switch_plugins_action($term_and_actions) { | |
| list($term, $actions) = $term_and_actions; | |
| $term_words = explode( ' ', $_REQUEST['term'] ); | |
| $keyword = $term_words[0]; | |
| <?php | |
| /** | |
| * Allows activation of plugins via WP Bulter using the "activate" keyword (ie "activate Gravity Forms") | |
| * | |
| */ | |
| add_filter('wp_butler_ajax_keyword_actions', 'wp_butler_switch_plugins_action'); | |
| function wp_butler_switch_plugins_action($term_and_actions) { | |
| list($term, $actions) = $term_and_actions; |
| <?php | |
| add_filter("the_content", "the_content_filter"); | |
| function the_content_filter($content) { | |
| // array of custom shortcodes requiring the fix | |
| $block = join("|",array("col","shortcode2","shortcode3")); | |
| // opening tag |
| #!/usr/bin/ruby | |
| # | |
| # The MIT License (MIT) | |
| # Copyright (c) 2013 Mark Jaquith | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| <?php | |
| define( 'DS', DIRECTORY_SEPARATOR ); | |
| # ================================== | |
| # PHP errors & log | |
| error_reporting( | |
| E_ALL | E_STRICT | E_CORE_ERROR | E_CORE_WARNING | |
| | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | |
| | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR | |
| ); | |
| # OR: shorter and all together |
| <?php | |
| # | |
| # rt-theme loop | |
| # | |
| global $args,$content_width,$paged; | |
| add_filter('excerpt_more', 'no_excerpt_more'); | |
| //varialbles | |
| $video_width = ($content_width =="960") ? 940 : 606; |
| # replace PAPERTRAIL_HOSTNAME and PAPERTRAIL_PORT | |
| # see http://help.papertrailapp.com/ for additional PHP syslog options | |
| function send_remote_syslog($message, $component = "web", $program = "next_big_thing") { | |
| $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); | |
| foreach(explode("\n", $message) as $line) { | |
| $syslog_message = "<22>" . date('M d H:i:s ') . $program . ' ' . $component . ': ' . $line; | |
| socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, PAPERTRAIL_HOSTNAME, PAPERTRAIL_PORT); | |
| } | |
| socket_close($sock); |