Skip to content

Instantly share code, notes, and snippets.

View wied03's full-sized avatar

Brady Wied wied03

View GitHub Profile
@wied03
wied03 / philips.yaml
Last active October 4, 2021 04:46
Philips Zigbee Switch
blueprint:
name: Philips Zigbee Switch
description: Create automations to react to double taps from supporting Philips switches.
domain: automation
input:
device:
name: Switch Device
description: A Philips switch that supports double taps.
selector:
@wied03
wied03 / ge_double.yaml
Last active October 4, 2021 13:47 — forked from kpine/ge_double.yaml
Homeseer Double Tap Generic Blueprint
blueprint:
name: Homeseer Double Taps
description: Create automations to react to double taps from supporting GE switches.
domain: automation
input:
device:
name: Switch Device
description: A Homeseer switch that supports double taps.
selector:
blueprint:
name: Water main shutoff
description: Shutoff water main when there is a leak
domain: automation
input:
water_cutoff_target:
name: Water cutoff valve
selector:
target:
entity:
@wied03
wied03 / water_leak_hi.yaml
Last active October 4, 2021 01:58
water leak high severity
blueprint:
name: Leak detection & notifier
description: Send a notification when any configured moisture sensor becomes moist
domain: automation
trigger:
- event_data: {}
event_type: state_changed
platform: event
@wied03
wied03 / option.rb
Created April 29, 2016 14:13
React tests with RSpec
require 'components/base'
require 'react-opal'
require 'components/mixins/default'
class Components::Base::Option
include React::Component
include Components::Mixins::Default
def option_args
result = { value: params[:value] }
inject function method_missing_stub() {
// Copy any given block onto the method_missing dispatcher
this.$method_missing.$$p = method_missing_stub.$$p;
// Set block property to null ready for the next call (stop false-positives)
method_missing_stub.$$p = null;
// call method missing with correct args (remove '$' prefix on method name)
return this.$method_missing.apply(this, [method_name.slice(1)].concat($slice.call(arguments)));
}
all for (:super, nil, (:iter, (:masgn, (:array, (:lasgn, :k), (:lasgn, :v))), (:returnable_yield, (:lvar, :k), (:lvar, :v)))) - #<Opal::Nodes::SuperNode:0x0056277d5a20f8> - compile_super_locator foo
call for (:super, nil, (:iter, (:masgn, (:array, (:lasgn, :k), (:lasgn, :v))), (:returnable_yield, (:lvar, :k), (:lvar, :v)))) - #<Opal::Nodes::SuperNode:0x0056277d5a20f8> - compile_super_locator using iter_sexp of (:iter, (:masgn, (:array, (:lasgn, :k), (:lasgn, :v))), (:returnable_yield, (:lvar, :k), (:lvar, :v))) to define iter
#<Opal::Nodes::IterNode:0x0056277d5baea0> - Pushing: if (k == null) k = nil;
#<Opal::Nodes::IterNode:0x0056277d5baea0> - Pushing: if (v == null) v = nil;
compiler, got called from /host/opal/lib/opal/nodes/iter.rb:112:in `body' with sexp (:returnable_yield, (:lvar, :k), (:lvar, :v))
#<Opal::Nodes::JSReturnNode:0x0056277d5b8330> - Pushing: return
#<Opal::Nodes::LocalVariableNode:0x0056277d5bfe28> - Pushing: k
#<Opal::Nodes::LocalVariableNode:0x0056277d5bfba8> - Pushing: v
#<Opal::Nodes::
class Foobar
def some_method(&block)
block['the_key', 'the_value']
end
# def foobar(&block)
# block['foo key', 'foo value']
# end
end
bundle exec opal -c get_optimization_status.rb | node --allow-natives-syntax