This class is designed to be fully compatible with the imp003's hardware.spiflash class but for use in driving an independant flash chip (such as MX25L3206EM2I-12G 32 Mbit SPI FLASH from Macronix attached to a SPI port on the imp's pins.
This file contains 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
# Serially download all aws-lambda functions | |
# Assumes you have ran `aws configure` or have the AWS_DEFAULT_PROFILE variable set | |
# Works with "aws-cli/1.16.72 Python/3.6.7 Linux/4.15.0-42-generic botocore/1.12.62" | |
mkdir -p lambda_functions | |
for fn in $(aws lambda list-functions --output text --query "Functions[*].FunctionName" | xargs); | |
do | |
echo "Downloading function $fn ..." | |
aws lambda get-function --function-name $fn --output text --query 'Code.Location' | xargs wget -q --show-progress -O ./lambda_functions/$fn.zip | |
done |
This file contains 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
// ============================================================================= | |
class Timer { | |
self = null; | |
cancelled = false; | |
paused = false; | |
running = false; | |
callback = null; | |
interval = 0; | |
params = null; |
This file contains 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 class can be used to interact with a Amazon DynamoDB table | |
* | |
* @author Aron Steg <[email protected]> | |
* | |
* @version 0.0.1 | |
*/ | |
class AWSDynamoDB { | |
static version = [0, 0, 2]; |
This file contains 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
The MIT License (MIT) | |
Copyright (c) 2016 Electric Imp | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
This file contains 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
The MIT License (MIT) | |
Copyright (c) 2015 Electric Imp | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
This file contains 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
// Copyright (c) 2015 Initial State Technologies, Inc. | |
// This file is licensed under the MIT License | |
// http://opensource.org/licenses/MIT | |
class InitialState { | |
static version = [1,0,0]; | |
_bucketKey = null; | |
_accessKey = null; |
This file contains 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
/* | |
The physical space is divided into blocks (64k) and sectors (16k). | |
Erase (wiping 0's to 1's) is performed at the sector level. | |
The file system divides the available space into pages which the size of one or more sectors. | |
At the start of every spage is an header which contains: | |
- the file's id (two bytes) for identifying and rejoining parts of a file | |
- the span id (two bytes) for ordering the parts | |
- an optional filename (with length byte) | |
- the span's size (how much of the page is used) |
The SPI Flash Logger class manages all or a portion of a SPI flash (either via imp003+'s built-in SPI flash driver or any functionally compatible driver) and turns it into an logger. It will log any serialisable object (table, array, string, blob, integer, float, boolean and null) and when it reaches the end of the available space it will override the oldest data first.
This file contains 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
#require "Rocky.class.nut:1.1.1" | |
class RockyII extends Rocky { | |
function _addAccessControl(res) { | |
res.header("Access-Control-Allow-Origin", "*") | |
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); | |
res.header("Access-Control-Allow-Methods", "POST, PUT, GET, OPTIONS, PATCH, DELETE"); | |
res.header("Access-Control-Expose-Headers", "X-ImpBase-Version"); | |
} | |
} |
NewerOlder