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
name: PlatformIO CI | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest |
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
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"); |
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
// 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("_"); |
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
// | |
// 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(); |