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
#include <Adafruit_NeoPixel.h> | |
#define PIN 8 | |
#define NUMPIXELS 12 | |
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); | |
int photocellPin = A0; // the cell and 10K pulldown are connected to a0 | |
int photocellReading; // the analog reading from the sensor divider | |
bool lightStatus = false; | |
int lightCounter = 0; |
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
#include <avr/sleep.h> | |
#include <avr/power.h> | |
#include <avr/wdt.h> | |
volatile int f_wdt = 1; | |
int relayPowerPin = 3; // I supply the relay with 5v power using this pin | |
int lightSensorPowerPin = 4; // I supply the photoresistor with 5v power using this pin | |
int relayDataPin = 7; // Output pin for switching relay | |
int lightDataPin = A2; // Input pin for reading photoresistance | |
int clockAdjustment; // I use this to manage my delays so things work smoother |
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
USE [Your Database] | |
GO | |
CREATE Function [dbo].[CheckHoliday] (@ReferenceDate date) | |
returns bit | |
as | |
BEGIN | |
DECLARE @Holiday bit | |
DECLARE @Year int = YEAR(@ReferenceDate) | |
,@Month int = MONTH(@ReferenceDate) |
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
function Update-VersionNumber { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory=$false, ValueFromPipeline=$true)] | |
[Alias('define')] | |
[String]$VersionNumber = "*.*.*.+", | |
[Parameter(Mandatory=$false)] | |
[Alias('Current','c')] | |
[Switch]$CurrentVersion | |
) |
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
/********************************************** | |
* Zuul IoT Delegation Manager - ZUULJS.COM | |
* Example Code | |
* | |
* Tyler W. Walch | |
* TINKERTAMPER.COM [2017] | |
***********************************************/ | |
/* CONFIGURE SHARED VARIABLES. | |
* Shared light status variable allows for all functions to react |
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
// Modeling the example posed by Ashwin Bhat in ElectroDB | |
// https://medium.com/developing-koan/modeling-graph-relationships-in-dynamodb-c06141612a70 | |
const {Entity, Service} = require("electrodb"); | |
const Roles = { | |
"lead": "500", | |
"contributor": "400", | |
"team": "300", | |
} |
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 aim of this exercise is ultimately to inspire communication and be starting place to drive discussion | |
* on methodology, general approach, and universal best practices. To frame how best to think about this code is | |
* that it represents a happy path POC, and your task is to use your personal experience to identify and discuss | |
* improvements, recommendations and potental changes that you'd recommend to get this service production ready. | |
* | |
* Please examine this document, familize yourself, come up with any questions you have and ultimately lets meet | |
* and discuss your thoughts. You don't need to write any code in the meantime. | |
* | |
* Note: |
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 aim of this exercise is ultimately to inspire communication and be starting place to drive discussion | |
* on methodology, general approach, and universal best practices. To frame how best to think about this code is | |
* that it represents a happy path POC, and your task is to use your personal experience to identify and discuss | |
* improvements, recommendations and potental changes that you'd recommend to get this service production ready. | |
* | |
* Please examine this document, familize yourself, come up with any questions you have and ultimately lets meet | |
* and discuss your thoughts. You don't need to write any code in the meantime. | |
* | |
* Note: |
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
const DynamoDB = require("aws-sdk/clients/dynamodb"); | |
const client = new DynamoDB.DocumentClient({ | |
region: "us-east-1", | |
endpoint: "http://localhost:8000" | |
}); | |
/** | |
* withNumbers demonstrates the update of a "composite" gsi sortkey without knowledge of the current | |
* composite value at the time of update. This works runs without error and operates as expected. | |
*/ |
OlderNewer