This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Parse partial seconds to milliseconds. | |
| * | |
| * Expects the integer from behind the dot. | |
| * If the original time string is "1.23" it expects "23" and will return "230" | |
| * | |
| * @param string $ms_string | |
| * @return int | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function move_comments( $from_post_id, $to_post_id ) { | |
| global $wpdb; | |
| $sql = sprintf( | |
| 'UPDATE %s SET comment_post_id=%s WHERE comment_post_id=%s;', | |
| $wpdb->comments, | |
| (int) $to_post_id, | |
| (int) $from_post_id | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // copy all comments from post $post_id to post $new_post_id | |
| foreach ( get_comments( array( 'post_id' => $post_id ) ) as $comment ) { | |
| $comment->comment_post_ID = $new_post_id; | |
| wp_insert_comment( (array) $comment ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "yaml" | |
| class Object | |
| def blank? | |
| respond_to?(:empty?) ? empty? : !self | |
| end | |
| def present? | |
| !blank? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| spl_autoload_register( function ( $class_name ) { | |
| $camelcase_to_snakecase = function ( $string ) { | |
| return preg_replace( '/([a-z])([A-Z])/', '$1_$2', $string ); | |
| }; | |
| $split = explode( '\\\\', $class_name ); | |
| // remove "Inpsyde" namespace | |
| $vendor = array_shift( $split ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace Podlove; | |
| /** | |
| * Chapter management class. | |
| * Consumes mp4chaps and spits out valid psc xml. | |
| * | |
| * @see http://podlove.org/simple-chapters/ | |
| */ | |
| class Chapters { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Adds asterisk after currency symbol. | |
| * | |
| * Hint: It will only look ok if your currency symbol is to the *right* of the | |
| * price (10$*). Otherwise it won't look as intended ($*10). | |
| * | |
| * @param string $currency_symbol | |
| * @param string $currency | |
| * @return string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "uglifier" # gem install uglifier, requires node.js | |
| require "yui/compressor" # gem install require "yui/compressor" | |
| require "fileutils" | |
| desc "prepare javascript files for production" | |
| task "prepare:js" do | |
| minify "js/*.js" do |file| | |
| Uglifier.compile File.read(file) | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ➜ curl -I http://rederadio.de/ | |
| HTTP/1.1 200 OK | |
| Date: Thu, 13 Sep 2012 18:23:58 GMT | |
| Server: Apache/2.2.15 (CentOS) | |
| X-Powered-By: PHP/5.4.4 | |
| X-Pingback: http://rederadio.de/xmlrpc.php | |
| Connection: close | |
| Content-Type: text/html; charset=UTF-8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 235,236c235,236 | |
| < define( 'RWMB_URL', trailingslashit( get_stylesheet_directory_uri().'/framework/functions/meta-box' ) ); | |
| < define( 'RWMB_DIR', trailingslashit( get_stylesheet_directory().'/framework/functions/meta-box' ) ); | |
| --- | |
| > define( 'RWMB_URL', get_template_directory_uri().'/framework/functions/meta-box/' ); | |
| > define( 'RWMB_DIR', get_template_directory().'/framework/functions/meta-box/' ); | |
| 242c242 | |
| < include get_stylesheet_directory().'/framework/functions/meta-box.php'; | |
| --- | |
| > include get_template_directory().'/framework/functions/meta-box.php'; |