Skip to content

Instantly share code, notes, and snippets.

View trovster's full-sized avatar

Trevor Morris trovster

View GitHub Profile
#I currently have this method that returns a list of reads from a cube.
/**
* returns the current reads for the device id passed to it
* @param string $device_id the device uid to use
* @return array the device current reads from the API
*/
public function getDeviceCurrentReads($device_id = NULL, $filter = false)
{
if (is_null($device_id)) return NULL;
@trovster
trovster / gist:4319969
Created December 17, 2012 17:13 — forked from anonymous/gist:4319896
If you have Tweenest —http://pongsocket.com/tweetnest/ — installed, then the following two functions will pull that data in to your WordPress install. This code assumes that the default table prefix is used (tn_).
<?php
function get_tweetnest_tweets($args) {
global $wpdb;
$args = shortcode_atts(array(
'count' => 5,
), $args);
$sql = sprintf("SELECT `tn_tweets`.*, `tn_tweetusers`.`screenname`, `tn_tweetusers`.`realname`, `tn_tweetusers`.`profileimage`
FROM `tn_tweets`