Skip to content

Instantly share code, notes, and snippets.

@lbrutti
lbrutti / cr200x.pl
Created Feb 15, 2020
Perl script for fetching data from Campbell scientific CR200X data logger
View cr200x.pl
#!/usr/bin/perl
# Requirements: Device::SerialPort 0.12 (from cpan)
#
# Description: This perl script is for logging of data from a serial
# port, to a specified logfile. The logfile can then be parsed with
# other programs for reporting purposes.
#
# EXAMPLE:
# perl -w serlog.pl test .log /dev/ttyS0 9600
#
@lbrutti
lbrutti / apply-templates.php
Created Oct 24, 2018
a simple php script to apply an XSLT to an XML file
View apply-templates.php
<?php
if (count($argv) == 0) {
exit;
}
$xsltPath = $argv[1];
$xmlPath = $argv[2];
// $outputPath = $argv[3];
$xslt = file_get_contents($xsltPath);
$xml = file_get_contents($xmlPath);
@lbrutti
lbrutti / gcal2moment-holiday.js
Created Jun 7, 2018
Converts json received from goggle cal API in format to be used in moment-holiday plugin locale files
View gcal2moment-holiday.js
//depends on lodash
var momentHolidays = {};
_.map(googleRes.items, function(o) {
momentHolidays[o.summary] = {
'date': (o.start.date.split("-")[1] + '/' + o.start.date.split("-")[2])
};
});
You can’t perform that action at this time.