This file contains 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
import { css, ObjectInterpolation } from "emotion"; | |
export type IStyles = { [key: string]: ObjectInterpolation<undefined> }; | |
export function useStyles< | |
TStyleDefinitions extends { [key: string]: ObjectInterpolation<undefined> }, | |
TStyleDefinitionNames extends keyof TStyleDefinitions | |
>( | |
styleDefinitions: { | |
[key in TStyleDefinitionNames]: ObjectInterpolation<undefined>; |
This file contains 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
type IDirection = "asc" | "desc"; | |
export function awesomeSort<T>( | |
array: Array<T>, | |
getters: Array<(el: T) => { value: unknown; direction: IDirection }> | |
) { | |
const arrayToSort = [...array]; | |
return arrayToSort.sort((a, b) => { | |
for (const getter of getters) { |
This file contains 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 onOpen() { | |
SlidesApp.getUi() | |
.createMenu("Dice") | |
.addItem("Roll 4df", "runFudgeDice") | |
.addToUi(); | |
update(); | |
} | |
function runFudgeDice() { | |
const fudgeDice = [-1, -1, 0, 0, 1, 1]; |