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
| blueprint: | |
| name: ZHA - Moes Tuya Smart Knob (TS004F) controller for lights | |
| description: Control lights with a Moes Tuya smart knob (the spinny ones). You can set functions for single press, and rotating left/right will change the brightness smoothly of the selected light. | |
| domain: automation | |
| source_url: https://gist.github.com/blizzrdof77/0f686e66db30c871e362e24388c3f8fa | |
| input: | |
| remote: | |
| name: Remote | |
| description: Moes Tuya Smart Knob Device to use | |
| selector: |
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
| // -Wglobals Clang plugin | |
| // | |
| // Based on example plugins and searching Clang's API documentation. | |
| // BEWARE! This is my first ever attempt at a Clang plugin. | |
| // | |
| // Written by John Bartholomew <jpa.bartholomew@gmail.com> | |
| #include "clang/Frontend/FrontendPluginRegistry.h" | |
| #include "clang/AST/AST.h" | |
| #include "clang/AST/ASTConsumer.h" |
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
| // consider the following code | |
| // a.js | |
| class A extends Component { | |
| static B = undefined; | |
| state = { B : A.B }; | |
| componentWillMount() { | |
| A.B || import('./b.js').then(B => { |
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
| declare module chrome.usb { | |
| type Direction = 'in' | 'out'; | |
| interface Device { | |
| device: number, | |
| vendorId: number, | |
| productId: number, | |
| productName: string, | |
| manufacturerName: string, | |
| serialNumber: string |
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
| function Template(str, data) { | |
| return str.replace(/\${([^}]+)}/g, (_, name) => data[name]); | |
| } | |
| var answer = 42; | |
| (function () { | |
| var answer = 60; | |
| console.log(Template('Answer is ${answer}', {answer})); | |
| })(); |