Skip to content

Instantly share code, notes, and snippets.

View thathardwareguy's full-sized avatar
🎯
Focusing

Kayode Alade thathardwareguy

🎯
Focusing
View GitHub Profile
name: PlatformIO CI
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
const aws = require("aws-sdk");
const semver = require("semver");
exports.handler = async (event) => {
try {
const versionValid = validateVersionParam(event);
// is rawVersion valid?
if (!versionValid) {
console.log("Failed to Pass Query Parameter");
// Load the AWS SDK for Node.js
const aws = require('aws-sdk');
// Create the DynamoDB service object
const ddb = new AWS.DynamoDB.DocumentClient();
const firmwareTable = process.env.FIRMWARE_TABLE;
exports.handler = async (event) => {
const bucketName = event.Records[0].s3.bucket.name;
const fileName = event.Records[0].s3.object.key;
const s3Time = event.Records[0].eventTime;
const [file,deviceType,ver] = fileName.split("_");
@thathardwareguy
thathardwareguy / gist:06301df67bc2a43d6b12016339b76da7
Created November 23, 2021 07:55 — forked from mattfelsen/gist:9467420
Splitting strings by a delimiter for Arduino
//
// This is tested and works!
//
String input = "123,456";
int firstVal, secondVal;
for (int i = 0; i < input.length(); i++) {
if (input.substring(i, i+1) == ",") {
firstVal = input.substring(0, i).toInt();
secondVal = input.substring(i+1).toInt();