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
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"time" | |
) | |
type Broker struct { |
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
#!/usr/bin/env ruby | |
class Location | |
attr_reader :name, :name_only, :number | |
def initialize(name) | |
@name = name | |
match = name.match(/(^[a-z]+)(\d+)?/) | |
@name_only = match[1] | |
@number = match[2].to_i |
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
module Rake::DSL | |
def before_all(*args) | |
args.each do |pair| | |
matchers, task_names = pair.to_a.first | |
tasks = [] | |
[ *matchers ].each do |matcher| | |
matcher = matcher.to_s if matcher.is_a?(Symbol) | |
tasks += Rake::Task.tasks.select { |task| !!task.name.match(matcher) } | |
end |
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 "esphome.h" | |
#include "driver/rtc_io.h" | |
class CustomSleepComponent : public Component, public CustomMQTTDevice { | |
public: | |
void setup() override { | |
subscribe(TOPIC_SLEEP_DURATION, &CustomSleepComponent::on_sleep_duration_message); | |
subscribe(TOPIC_SLEEP_PREVENT, &CustomSleepComponent::on_prevent_message); | |
subscribe(TOPIC_SLEEP_ENTER, &CustomSleepComponent::on_enter_message); |
OlderNewer