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
| CREATE TABLE IF NOT EXISTS `samples` ( | |
| `id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL, | |
| `value` float(8,2) NOT NULL, | |
| `createdAt` datetime NOT NULL, | |
| PRIMARY KEY (`id`), | |
| KEY `samples_created_at` (`createdAt`) | |
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | |
| INSERT INTO `samples` (`id`, `value`, `createdAt`) | |
| VALUES |
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
| CREATE USER 'user'@'host' IDENTIFIED BY 'pass'; | |
| GRANT ALL PRIVILEGES ON `db`.* TO 'user'@'host' IDENTIFIED BY 'pass'; | |
| FLUSH PRIVILEGES; |
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
| import Hashids from 'hashids'; | |
| const hashids = new Hashids( | |
| process.env.HASHIDS_SALT, | |
| 4, | |
| 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890', | |
| ); | |
| export const encode = (id: number): string => hashids.encode(id); | |
| export const decode = (id: string): number | null => { |
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
| SELECT | |
| sensors.type, | |
| samples.value, | |
| DATE_FORMAT( | |
| CONVERT_TZ( | |
| samples.createdAt, | |
| '+00:00', | |
| '+01:00' | |
| ), | |
| '%Y-%m-%d %h:%i %p' |
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
| #include <Wire.h> | |
| #include <ESP8266WebServer.h> | |
| #include <TSL2561.h> | |
| const char *ssid = "Wouter's Place"; | |
| const char *password = ""; | |
| ESP8266WebServer server(80); | |
| TSL2561 tsl2561(TSL2561_ADDR_FLOAT); |
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
| #include <Wire.h> | |
| #include <ESP8266WiFi.h> | |
| #include <WiFiClient.h> | |
| #include <ESP8266WebServer.h> | |
| #define LED D1 | |
| const char *ssid = "Wouter's Place"; | |
| const char *password = ""; |
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
| void setup() { | |
| pinMode(LED_BUILTIN, OUTPUT); | |
| } | |
| void loop() { | |
| digitalWrite(LED_BUILTIN, HIGH); | |
| delay(1000); | |
| digitalWrite(LED_BUILTIN, LOW); | |
| delay(1000); |
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 axios = require('axios'); | |
| const chalk = require('chalk'); | |
| const sleep = require('await-sleep'); | |
| const checkCode = async (code) => { | |
| const codes = [code]; | |
| const response = await axios.post('https://winadrone.kelloggs.com/api/nl_BE/redemption/validate-codes', { codes }); | |
| const { data } = response; |
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
| /* | |
| * sixpair.c version 2007-04-18 | |
| * Modified to run on Mac OSX by | |
| * Erlend Cleveland 2011-09-04 | |
| * | |
| * Compile with: gcc -o sixpair sixpair.c -lusb | |
| */ | |
| #include <string.h> | |
| #include <unistd.h> |
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
| # Overclock | |
| arm_freq=1350 | |
| core_freq=500 | |
| over_voltage=4 | |
| disable_splash=1 | |
| force_turbo=1 | |
| boot_delay=1 | |
| gpu_mem=320 | |
| # Hdmi fixes |