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
#!/usr/bin/perl | |
# http://search.cpan.org/~dpavlin/Redis-0.0801/lib/Redis.pm | |
use 5.010 ; | |
use strict ; | |
use warnings ; | |
use Data::Dumper ; | |
use Redis ; | |
{ | |
# Using the data |
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
#!/usr/bin/env python | |
''' | |
Description: | |
Using the FitBit API get the device info | |
then, put it into the Redis NoSQL database for other programs to check | |
Displays: | |
<?xml version="1.0" encoding="UTF-8"?><result><summary><activeScore>44</activeScore><caloriesOut>1894</caloriesOut><distances><activityDistance><activity>total</activity><distance>0.11</distance></activityDistance><activityDistance><activity>tracker</activity><distance>0.11</distance></activityDistance><activityDistance><activity>loggedActivities</activity><distance>0</distance></activityDistance><activityDistance><activity>veryActive</activity><distance>0</distance></activityDistance><activityDistance><activity>moderatelyActive</activity><distance>0.03</distance></activityDistance><activityDistance><activity>lightlyActive</activity><distance>0.08</distance></activityDistance><activityDistance><activity>sedentaryActive</activity><distance>0</distance></activityDistance></distances><fairlyActiveMinutes>7</fairlyActiveMinutes><lightlyAct |
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
def yaml_test( *args ): | |
config = '~/twitter.cnf' | |
assert 0 <= len(args) < 2 | |
if len(args)==1: | |
config = args[0] | |
do_yaml( config ) |
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
#!/usr/bin/env python | |
''' | |
Probably don't need the hashbang here. Leaving it anyway. | |
This is a module that creates a FitBit access class. This is the most | |
in-depth Python coding I've ever written. | |
This is based on sample code I found in a forum online, so I pass on this |
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
#!/usr/bin/env python | |
import sys | |
import yaml | |
import MySQLdb as db | |
class Database: | |
config = '' | |
def __init__( self , client="default" ): |
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
#!/usr/bin/perl | |
use strict ; | |
use warnings ; | |
use 5.010 ; | |
use CGI ; | |
use CGI::Carp qw( fatalsToBrowser ) ; | |
use Data::Dumper ; | |
use lib '/home/ltl/lib' ; | |
use LTLcommon qw{ pi_Readfile } ; |
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( sqlutils ) | |
require( RMySQL ) | |
library( Cairo ) | |
library( yaml ) | |
my.cnf = yaml.load_file( '~/.my.yaml' ) | |
default = my.cnf$clients$default | |
p_cols <- c( "blue" , "red" , "orange" , "green" ) | |
con <- dbConnect( |
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
// --------- --------- --------- --------- --------- --------- --------- | |
// function to dynamically create a large number of sample fields | |
// --------- --------- --------- --------- --------- --------- --------- | |
function create_new_samples ( n ) { | |
for ( var i = 1 ; i <= n ; i++ ) { | |
$( '<div\>') | |
.attr( 'id' , 'div_' + i ) | |
.appendTo( '#sample_dump' ) | |
.append( | |
$( '<fieldset/>' ) |
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
package Beats ; | |
use strict ; | |
use warnings ; | |
use Exporter qw(import) ; | |
use DateTime ; | |
our $VERSION = 0.0.1 ; | |
our @EXPORT = qw( time_in_beats ) ; |
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
package MyDB ; | |
=head1 NAME | |
MyDB - Module handling access to MySQL databases | |
=head2 DESCRIPTION | |
Mostly used within DB.pm, which handles the actual queries. This handles | |
connecting to the actual databases. |