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
| interface CSSStyleDeclaration { | |
| willChange: string; | |
| } | |
| function positionAndDimensionsFromClientRect(element: HTMLElement, sourceClientRect: ClientRect) { | |
| element.style.top = sourceClientRect.top.toString(10) + 'px'; | |
| element.style.left = sourceClientRect.left.toString(10) + 'px'; | |
| element.style.width = sourceClientRect.width.toString(10) + 'px'; | |
| element.style.height = sourceClientRect.height.toString(10) + 'px'; | |
| } |
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 updateElement(target: Element, source: Element): Element { | |
| target = updateTagName(target, source.tagName); | |
| updateAttributes(target, source); | |
| updateChildNodes(target, source); | |
| return target; | |
| } | |
| function updateAttributes(target: Element, source: Element): void { | |
| const sourceAttributes = Array.from(source.attributes); | |
| const targetAttributes = Array.from(target.attributes); |
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 | |
| // https://www.youtube.com/watch?v=zzKGnuvX6IQ | |
| $dice = [ | |
| '333333' => [3, 3, 3, 3, 3, 3], | |
| '004444' => [4, 4, 4, 4, 0, 0], | |
| '111555' => [5, 5, 5, 1, 1, 1], | |
| '222266' => [2, 2, 2, 2, 6, 6], | |
| ]; |