Skip to content

Instantly share code, notes, and snippets.

@michaellunzer
michaellunzer / fn_generate_random.js
Created March 31, 2021 01:04
Twilio Generate Random Number Function
exports.handler = function(context, event, callback) {
let x = Math.floor(Math.random() * (9 - 1) + 1);
let y = Math.floor(Math.random() * (9 - 1) + 1);
const operators = ['+', '*', '-', '/'];
function randomOperator(operators) {
@michaellunzer
michaellunzer / codecard3.yaml
Created October 21, 2020 02:23
ESPHome ePaper 2.7inch Display ESP8266
esphome:
name: codecard3
platform: ESP8266
board: esp12e
# on_boot:
# - output.turn_off: onboard_led
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# this is a simple bash script to load up a hard coded spotify url and play it
# make sure to make the file excutable (chmod 777 autostart_music.sh)
# to add it on boot, look here: https://www.raspberrypi.org/documentation/linux/usage/rc-local.md
# Made by LUNZCORP
mpc clear # this clears any loaded music
mpc random on