✪ rqworker --db 10 default high
16:06:30 RQ worker started, version 0.3.7
16:06:30
16:06:30 *** Listening on default, high...
16:06:49 high: jobs.multiply(5, 2) (2df52ba2-bd32-4849-a8e1-c5241c78b542)
16:06:49 Job OK, result = 10
| #!/usr/bin/php | |
| <?php | |
| /* | |
| * Convert JSON file to CSV and output it. | |
| * | |
| * JSON should be an array of objects, dictionaries with simple data structure | |
| * and the same keys in each object. | |
| * The order of keys it took from the first element. | |
| * | |
| * Example: |
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.
| <?php | |
| /** | |
| * Add custom fields to Display Posts Shortcode | |
| * @author Bill Erickson | |
| * @link http://wordpress.org/extend/plugins/display-posts-shortcode/ | |
| * @link http://www.billerickson.net/shortcode-to-display-posts/comment-page-1/#comment-4565 | |
| * | |
| * @param $output string, the original markup for an individual post | |
| * @param $atts array, all the attributes passed to the shortcode | |
| * @param $image string, the image part of the output |
| <?php | |
| /* | |
| * Converts CSV to JSON | |
| * Example uses Google Spreadsheet CSV feed | |
| * csvToArray function I think I found on php.net | |
| */ | |
| header('Content-type: application/json'); | |
| // Set your CSV feed |
| <?php | |
| /** | |
| * CSV Class | |
| */ | |
| class CSV | |
| { | |
| public static function from_file($path = '') | |
| { |