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
| #!/bin/bash | |
| # encode.sh | |
| # | |
| # Copyright (c) 2013 Don Melton | |
| # | |
| # This version published on June 7, 2013. | |
| # | |
| # Re-encode video files in a format suitable for playback on Apple TV, Roku 3, | |
| # iOS, OS X, etc. |
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 | |
| /* Getting a JSON Facebook Feed | |
| ========================================================================== | |
| 1. Sign in as a developer at https://developers.facebook.com/ | |
| 2. Click "Create New App" at https://developers.facebook.com/apps | |
| 3. Under Apps Settings, find the App ID and App Secret |
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 | |
| // get next and prev products | |
| // Author: Georgy Bunin (bunin.co.il@gmail.com) | |
| // forked from https://gist.github.com/2176823 | |
| function ShowLinkToProduct($post_id, $categories_as_array, $label) { | |
| // get post according post id | |
| $query_args = array( 'post__in' => array($post_id), 'posts_per_page' => 1, 'post_status' => 'publish', 'post_type' => 'product', 'tax_query' => array( | |
| array( | |
| 'taxonomy' => 'product_cat', |
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 | |
| $rss = simplexml_load_file($argv[1]); | |
| foreach ($rss->channel->item as $item) { | |
| exec('wget --continue --directory-prefix="enclosures" ' . escapeshellarg($item->enclosure['url'])); | |
| } |
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
| .fc { | |
| direction: ltr; | |
| text-align: left; } | |
| .fc table { | |
| border-collapse: collapse; | |
| border-spacing: 0; } | |
| .fc .btn { | |
| line-height: 1.2em; } | |
| html .fc { |
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 | |
| //Force SSL so that passwords aren't sent in the clear. | |
| if($_SERVER["HTTPS"] != "on") { | |
| header("HTTP/1.1 301 Moved Permanently"); | |
| header("Location: https://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]); | |
| exit(); | |
| } | |
| //Here's where the Wordpress magic happens. |
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 | |
| // This function will return "now", "3 seconds ago", "1 month ago" etc ... | |
| function get_the_relative_time($time = null) | |
| { | |
| if(is_null($time)) $time = get_the_time("U"); | |
| $time_diff = date("U") - $time; // difference in second | |
| $second = 1; | |
| $minute = 60; |
NewerOlder