Skip to content

Instantly share code, notes, and snippets.

@richiejarvis
richiejarvis / seriallogger.js
Created December 21, 2019 12:32 — forked from yevgenko/seriallogger.js
Log all output from a serial port connection to a log file.
/*
Simple example that takes a command line provided serial port destination and routes the output to a file of the same name with .log appended to the port name.
usage: node logger.js /dev/tty.usbserial <baudrate>
*/
var SerialPort = require("serialport");
var fs = require("fs");
var port = process.argv[2];
@richiejarvis
richiejarvis / gist:1dd18c1e905df850d508959c6b348d7e
Created March 29, 2022 12:44
Example python3 publish via Ably
#!/usr/bin/env python3
from __future__ import print_function
import sys
import os
import time
import asyncio
from ably import AblyRest
my_path = os.path.abspath(__file__) # Find the full path of this python script
# get the path location only (excluding script name)
base_dir = my_path[0:my_path.rfind("/")+1]