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 { PerformanceObserver, performance } from "node:perf_hooks"; | |
import type { PerformanceEntry } from "node:perf_hooks"; | |
export function startDurationMeasurement(name: string) { | |
const id = crypto.randomUUID(); | |
const measurementName = `${name}-measurementName-${id}`; | |
const startMark = `${name}-startMark-${id}`; | |
const endMark = `${name}-endMark-${id}`; |
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 React from 'react' | |
export type Props = { | |
show: boolean | |
children: React.ReactNode | |
animate(args: { el: HTMLDivElement; show: boolean }): Animation | |
} | |
export const AnimateMounting: React.FunctionComponent<Props> = ({ show, children, animate }) => { | |
const elRef = React.useRef<HTMLDivElement>(null) |
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 React from 'react' | |
declare var $: any | |
export type Select2Ref = { | |
getValue(): string | string[] | null | |
setValue(val: string | string[]): void | |
clear(): void | |
} |
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 { useEffect } from 'react' | |
import { useLocation } from 'react-router-dom' | |
import { usePrevious } from './use-previous' | |
import { useStopWatch } from './use-stop-watch' | |
export const usePageTracker = () => { | |
const location = useLocation() | |
const pathname = usePrevious(location.pathname) | |
const sw = useStopWatch() |
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
.partymode--container { | |
position: fixed; | |
z-index: 10000; | |
left: 0; | |
top: 0; | |
right: 0; | |
bottom: 0; | |
overflow: hidden; | |
pointer-events: none; |
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 React from 'react' | |
import ReactDOM from 'react-dom' | |
export function useTooltip<Props>(): { | |
openPopover(component: React.FunctionComponentElement<Props>): void | |
closePopover(): void | |
} { | |
const mountNodeRef = React.useRef<HTMLDivElement>() | |
const openPopover = (component: React.FunctionComponentElement<Props>) => { |
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
details summary { | |
cursor: pointer; | |
outline: none !important; | |
display: inline-block; | |
padding: 8px 12px; | |
padding-top: 10px; | |
border-radius: 4px; | |
overflow: hidden; | |
background: #F09825; | |
color: white; |
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
// ==UserScript==// | |
// @name Wanikani Final Fantasy victory fanfare | |
// @namespace https://gist.github.com/reyronald/e3c1d27872d2d500335ddf01f560c5e5 | |
// @version 0.4 | |
// @description Plays the Final Fantasy Victory Fanfare on Wanikani level up | |
// @author Ronald Rey @reyronald (reyronald@gmail.com) | |
// @match *://www.wanikani.com/* | |
// @grant none | |
// @downloadURL https://gist.githubusercontent.com/reyronald/e3c1d27872d2d500335ddf01f560c5e5/raw/wanikaniVictoryFanfare.user.js | |
// @updateURL https://gist.githubusercontent.com/reyronald/e3c1d27872d2d500335ddf01f560c5e5/raw/wanikaniVictoryFanfare.user.js |
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 React from 'react' | |
import { Overlay, Popover } from 'react-bootstrap' | |
function useTooltip() { | |
const mountNodeRef = React.useRef<HTMLDivElement>() | |
React.useEffect(() => { | |
const mountNode = document.createElement('div') | |
mountNodeRef.current = mountNode |
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
// From https://apex.sh/ | |
:root { | |
--ease: cubic-bezier(0.075,0.82,0.165,1.15); | |
} |