Skip to content

Instantly share code, notes, and snippets.

Rudolph Gottesheim MidnightDesign

Block or report user

Report or block MidnightDesign

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View element-move-transition.ts
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';
}
View update-dom.ts
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);
View the-most-powerful-dice.php
<?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],
];
You can’t perform that action at this time.