Skip to content

Instantly share code, notes, and snippets.

View RPDeshaies's full-sized avatar

rpdeshaies RPDeshaies

View GitHub Profile
@RPDeshaies
RPDeshaies / GoogleSlidesFudgeDice.gs
Last active April 17, 2020 02:16
Google Slides Fudge Dice
function onOpen() {
SlidesApp.getUi()
.createMenu("Dice")
.addItem("Roll 4df", "runFudgeDice")
.addToUi();
update();
}
function runFudgeDice() {
const fudgeDice = [-1, -1, 0, 0, 1, 1];
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) {
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>;