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 OpenAI = require('openai'), | |
readline = require('readline'); | |
// Initialize OpenAI with API key | |
const openai = new OpenAI({ | |
apiKey: "" // your-api-key-here | |
// For extra safety, use the line below, comment the line above and pass the API key as an environment variable: | |
// apiKey: process.env['OPENAI_API_KEY'] | |
}); |
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
substitutions: | |
name: climate-control-esph-1337 | |
friendly_name: Climate Control ESPH-1337 | |
pin_status_led: GPIO2 | |
pin_transmitter: GPIO4 | |
pin_receiver: GPIO12 | |
pin_dht: GPIO14 | |
esphome: | |
name: ${name} |
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
/* | |
ESP 32 Blink | |
Turns on an LED on for one second, then off for one second, repeatedly. | |
The ESP32 has an internal blue LED at D2 (GPIO 02) | |
*/ | |
// int LED_BUILTIN = 2; | |
void setup() | |
{ |
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 is an ESPHome configuration for an Outdoor Weather Station. | |
# The configuration includes a raindrop coverage sensor and a rain sensor. | |
# The raindrop coverage sensor uses an ADC to measure water resistance, | |
# while the rain sensor is a digital sensor indicating whether it is raining or not. | |
# | |
# The configuration uses substitutions to define all the configurable parts, | |
# making it easy to adjust pins and other settings without modifying the entire file. | |
substitutions: | |
name: esph-29697f-ows-1 |
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
/** | |
* Get layerX and layerY of an event across all browsers without | |
* using the deprecated layerX of webkit. | |
* It stores `targetX` and `targetY` in the event, to act like `layerY` | |
* and `layerY` respectively. | |
*/ | |
getElementPosition = (function () { | |
var body = window.document.body || window.document.documentElement; | |
return function (event) { |
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 <WiFi.h> | |
#include <NTPClient.h> | |
// dependencies | |
#include "TOTP++.h" | |
#include "SSD1306.h" | |
// replace with your network credentials | |
const char* ssid = "Redacted"; | |
const char* password = "Redacted"; |
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
/** | |
* @module describe-it | |
* | |
* This module defines global variables to provide unit test case runner functions compatible with mocha and jasmine. | |
* The codebase is written for brevity and facilitate being as lightweight as possible. | |
* | |
* The code is intended to be included in Postman Test Sandbox. | |
*/ | |
/** |
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
aws ec2 associate-address --instance-id $1 --public-ip $(aws ec2 allocate-address --output text --query 'PublicIp') |
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
watch -n 30 say It is time |
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("microtime"); | |
const | |
_ = require('lodash'), | |
Benchmark = require('benchmark'), | |
suite = new Benchmark.Suite, | |
result = [], | |
seedSize = 10000, | |
seedData = Array(seedSize).fill().map(() => String(Math.round(Math.random() * seedSize))).reduce((obj, val) => { |
NewerOlder