Skip to content

Instantly share code, notes, and snippets.

@krkeegan
krkeegan / gist:8545149
Created January 21, 2014 18:14
Brad's DS2048 Code
sub write_iButton_io {
my $io_state = $Save{Preset_Relay_Setting}; #From TK input the correct arrangement of relays XX.
my $io_device = write_reg_2408 $ib_io1 hex($io_state);
print_log "Write Reg is $io_device, state is $io_state\n";
}
@krkeegan
krkeegan / read_table_A.pl
Created July 24, 2014 21:21
Example of possible Psuedo-Code for Table A Validation
#This would be called inside each definition, this is using SCENE_BUILD as an example:
validate_def(['name,1','name,1', 'boolean,0','boolean,0','insteon_on_level,0','insteon_ramp_rate,0'], \@item_info);
#Global validation routine:
sub validate_def {
my ($req_array, $passed_values);
my $i = 0;
for my $req_line (@{$req_array}){
my ($type, $req) = split(',',$req_line);
if ($type eq 'boolean'){
@krkeegan
krkeegan / weather.pl
Created August 5, 2014 22:37
MisterHouse Weather Underground Sample Excerpt
# Category = Interfaces
#@ Adds weather items to the web interface
use XML::Simple;
$p_w_forecast = new Process_Item qq[get_url "http://api.wunderground.com/api/<API>/forecast/q/KVNY.xml" "$config_parms{data_dir}/web/forecast.html"];
$p_w_conditions = new Process_Item qq[get_url "http://api.wunderground.com/weatherstation/WXCurrentObXML.asp?ID=KCASHERM6" "$config_parms{data_dir}/web/conditions.html"];
$p_w_forecast_hourly_wu = new Process_Item qq[get_url "http://api.wunderground.com/api/<API>/hourly/q/KVNY.xml" "$config_parms{data_dir}/web/hourly_wu.html"];
@krkeegan
krkeegan / generatecloudmap.py
Last active May 30, 2023 21:42
Missed an ampersand
'''
A Script for automatically downloding earth based image tiles and stitching
them into a single image file. Designed for downloading and stitching together
a cloud map file for use with xplanet. But it could be used for other things.
Images are obtained from the Space Science and Engineering Center (SSEC)
at the University of Wisconsin-Madison through their RealEarth project.
RealEarth is a data discovery and visualization platform developed at
SSEC/CIMSS at the University of Wisconsin-Madison to support outreach
and collaboration efforts of scientists.