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
#!/usr/bin/env ruby | |
# Print out your last 5 tovala deliveries, along with who the chef was and whether it was a best seller/chef's pick or not | |
# Add "csv" arg to get in csv format for easy adding to spreadhsheet (`./tovala.rb csv`) | |
require 'net/http' | |
require 'uri' | |
require 'json' | |
require 'date' |
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
.VideoButtons { | |
text-align: center; | |
margin: 3em auto 5.5em auto; | |
} | |
.VideoButtons span { | |
margin: 1em; | |
} | |
@media only screen and (max-width: 550px) { |
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
import paho.mqtt.client as mqtt | |
import json | |
def onConnect(client, userdata, flags, rc): | |
client.subscribe('hs/1/com.hiome/#/occupancy', qos=1) | |
def onMessage(client, userdata, payload): | |
topic = payload.topic.split('/') | |
room_id = topic[3] | |
msg = json.loads(payload.payload) |
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
def colorize(input): | |
# convert string to base36 and then scientific notation | |
a = '%E' % float(int(input, 36)) | |
scinot = a.split('E')[0].rstrip('0').rstrip('.') + 'E' + a.split('E')[1] | |
# convert decimal portion of scientific notation back to hex and pad to 6 values | |
return "#" + "{0:x}".format(int(scinot[2:-5]) & 0xFFFFFF)[-6:].zfill(6) |
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
# connect to Hiome Core | |
# if your OS cannot resolve hiome.local, install mDNS (Bonjour) support | |
# or use Hiome Core's IP address | |
mqtt: | |
broker: hiome.local | |
port: 1883 | |
client_id: home-assistant | |
keepalive: 60 | |
# add each room as a sensor |
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
version: "3" | |
services: | |
grafana: | |
image: grafana/grafana | |
container_name: grafana | |
restart: always | |
ports: | |
- 80:3000 | |
networks: | |
- grafana-net |
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 backToTop() { | |
var x1 = x2 = x3 = 0; | |
var y1 = y2 = y3 = 0; | |
if (document.documentElement) { | |
x1 = document.documentElement.scrollLeft || 0; | |
y1 = document.documentElement.scrollTop || 0; | |
} | |
if (document.body) { |
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
package com.tabuleapp.SendGrid; | |
import javax.mail.Authenticator; | |
import javax.mail.BodyPart; | |
import javax.mail.Message; | |
import javax.mail.MessagingException; | |
import javax.mail.Multipart; | |
import javax.mail.PasswordAuthentication; | |
import javax.mail.Session; | |
import javax.mail.Transport; |
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
str = str.replace(/^([\s\S]{0,87})[\s\S]*$/, "$1..."); |