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: "IKEA Bilresa Scrollwheel - 3 Zones, 3 Lights (V1.1.0)" | |
| author: "stone13 (original V1.0.5), modified: separate light per zone" | |
| description: | | |
| Light controller for the **IKEA Bilresa** scroll wheel via Matter. | |
| Based on stone13's "IKEA Bilresa Scrollwheel - Light Control V1.0.5". | |
| **What's different:** each of the three zones of the remote (scroll wheel + | |
| button) now has **its own light (or group)** and **its own scroll mode** — | |
| brightness, color temperature, color or presets. A zone's button controls |
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
| <?php | |
| function base64url_encode($data) { | |
| return rtrim(strtr(base64_encode($data), '+/', '-_'), '='); | |
| } | |
| function base64url_decode($data) { | |
| return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT)); | |
| } |
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 getNoun(number, one, two, five) { | |
| let n = Math.abs(number); | |
| n %= 100; | |
| if (n >= 5 && n <= 20) { | |
| return five; | |
| } | |
| n %= 10; | |
| if (n === 1) { | |
| return one; | |
| } |
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
| <?php | |
| class DateService | |
| { | |
| const ONE_WEEK_INTERVAL = '+6 days'; | |
| const THIRTY_DAYS_INTERVAL = '+29 days'; | |
| const ONE_YEAR_INTERVAL = '+364 days'; | |
| /** | |
| * This method get two dates (start and end of an interval) and length of every subinterval you need. |