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 DB ; | |
=head1 NAME | |
MyDB - Module handling access to MySQL databases | |
=head2 DESCRIPTION | |
This is the interface to the databases, abstracting all the complexity of | |
DBI into just a few functions. |
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
### Triple-hash comments are my commentary | |
### Assume I define some SQL here. | |
my $data = db_arrayref( $sql ) ; | |
###so I go through 3000+ rows of DB returns | |
for my $line ( @$data ) { | |
my @array ; | |
push @array, $$line[ 2 ] ; | |
### I should have this query outside the loop, but that's the least of my troubles |
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
# Tests for MyDB | |
use Test::More ; | |
# Does the module even exist | |
BEGIN { use_ok( 'MyDB' ) ; } | |
require_ok( 'MyDB' ) ; | |
subtest "function exists" => sub { | |
can_ok 'MyDB', 'db_connect' ; |
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 API ; | |
use 5.010 ; | |
use strict ; | |
use warnings ; | |
use CGI ; | |
use Exporter 'import' ; | |
use Data::Dumper ; | |
use JSON ; |
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 | |
# downloads last five days of fitbit info, not including the current day. | |
# the current day's info isn't finished, and I often don't have it sync | |
# during the weekend | |
import datetime | |
import httplib | |
import os | |
import simplejson as json |
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 5.010 ; | |
use strict ; | |
use warnings ; | |
use Math::BigInt ; | |
my $max = 500 ; | |
my @fib1 ; | |
my @fiba ; |
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 perl | |
=begin comment | |
cron_error.pl | |
Program used to check the Cron folder of my Purdue inbox, | |
to alert me if large amounts of errors start to be generated | |
in the crontab-run programs. Alerts happen, in this case, via | |
XMPP, specifically in this case via Google Talk, soon to be |
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
--- | |
consumer_key: <CONSUMER_KEY, available from Twitter> | |
consumer_secret: <CONSUMER_SECRET, available from Twitter> | |
tokens: | |
<YOUR_TWITTER_HANDLE>: | |
access_token: <GENERATED FIRST TIME YOU USE THIS SCRIPT> | |
access_token_secret: <GENERATED FIRST TIME YOU USE THIS SCRIPT> | |
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
/* | |
hidr.js -- hiding and displaying rows or columns | |
<fieldset class="hidr_buttons"> | |
<label> <input type="checkbox" value="abc"> </label> | |
<label> <input type="checkbox" value="def"> </label> | |
</fieldset> | |
<table class="hidr"> | |
<tr class="abc"><td class="def"> Foo </td></tr> |
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 Locked ; | |
use strict ; | |
use warnings ; | |
use Exporter qw(import) ; | |
our $VERSION = 0.0.1 ; | |
our %EXPORT_TAGS ; | |
our @EXPORT ; | |
my %prepared ; |