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 "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); |
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 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 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 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 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 bash | |
pushd $(dirname $0) > /dev/null; CURRABSPATH=$(readlink -nf "$(pwd)"); popd > /dev/null; # Get the directory in which the script resides | |
set -x | |
MUSLPKG="musl:musl.tgz:http://www.musl-libc.org/releases/musl-1.1.4.tar.gz" | |
LEVTPKG="libevent:libevent2.tgz:https://cloud.github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz" | |
TMUXPKG="tmux:tmux.tgz:https://github.com/tmux/tmux/releases/download/1.9a/tmux-1.9a.tar.gz" | |
NCRSPKG="ncurses:ncurses.tgz:http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz" | |
TEMPDIR="$CURRABSPATH/tmp" | |
TMPLIB="tempinstall/lib" | |
TMPINC="tempinstall/include" |
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
#!/bin/bash | |
consul agent \ | |
-bootstrap=true \ | |
-config-file=./consul.hcl \ | |
-data-dir=./consul_data \ | |
-bind=0.0.0.0 \ | |
-client=127.0.0.1 \ | |
-advertise=127.0.0.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
[DEBUG ] Reading configuration from /etc/salt/master | |
[DEBUG ] Using cached minion ID from /etc/salt/minion_id: master1 | |
[DEBUG ] Missing configuration file: ~/.saltrc | |
[DEBUG ] Configuration file path: /etc/salt/master | |
[DEBUG ] Reading configuration from /etc/salt/master | |
[DEBUG ] Using cached minion ID from /etc/salt/minion_id: master1 | |
[DEBUG ] Missing configuration file: ~/.saltrc | |
[DEBUG ] MasterEvent PUB socket URI: ipc:///var/run/salt/master/master_event_pub.ipc | |
[DEBUG ] MasterEvent PULL socket URI: ipc:///var/run/salt/master/master_event_pull.ipc | |
[DEBUG ] LazyLoaded local_cache.get_load |
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 python | |
# -*- coding: utf-8 -*- | |
# Author: Wilson Júnior <[email protected]> | |
import cmd | |
import sys | |
import os | |
import subprocess | |
import re | |
import readline |
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 MergeRecursive(obj1, obj2) { | |
for (var p in obj2) { | |
try { | |
// Property in destination object set; update its value. | |
if ( obj2[p].constructor==Object ) { | |
obj1[p] = MergeRecursive(obj1[p], obj2[p]); | |
} else { | |
obj1[p] = obj2[p]; | |
} | |
} catch(e) { |
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
config defaultToCurrentScreen true | |
config nudgePercentOf screenSize | |
config resizePercentOf screenSize | |
config secondsBetweenRepeat 0.1 | |
config checkDefaultsOnLoad true | |
config focusCheckWidthMax 3000 | |
config windowHintsIconAlpha 0.3 | |
config windowHintsFontColor 255;255;255;1 | |
config windowHintsBackgroundColor 0;0;0;0.3 | |
config windowHintsShowIcons true |
NewerOlder