This file contains some config files.
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
| const mergeSort = (xs) => { | |
| if (xs.length <= 1) return xs; | |
| const midIndex = Math.trunc(xs.length / 2); | |
| return merge( | |
| mergeSort(xs.slice(0, midIndex)), | |
| mergeSort(xs.slice(midIndex)), | |
| ); | |
| } | |
| const merge = (xs, ys) => { |
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
| <div ref="container"> | |
| <Card v-for="(card, i) of cards" ref="cards"> | |
| <IntersectionObserver :getTarget="() => this.$refs.cards[i]" @intersect="liftCard" @disintersect="unliftCard" /> | |
| ... | |
| </Card> | |
| </div> | |
| <!-- vs --> | |
| <div ref="container"> |
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
| export const requestAnimationFrameRecursive = ( | |
| fn: ( | |
| highResTimestamp: DOMHighResTimeStamp, | |
| additionalInfo: { | |
| stop: () => void; | |
| totalTimelapse: DOMHighResTimeStamp; | |
| timelapseSinceLast: DOMHighResTimeStamp; | |
| }, | |
| ) => void, | |
| o?: { |
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
| type OmitRecursive<T extends object, O extends string> = Omit< | |
| { [K in keyof T]: T[K] extends object ? OmitRecursive<T[K], O> : T[K] }, | |
| O | |
| > | |
| const removeKeysRecursive = <T extends object, K extends readonly string[]>( | |
| object: T, | |
| keys: K, | |
| ): OmitRecursive<T, K[number]> => { |
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
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions |
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
| export const groupBy = <X, K extends PropertyKey>( | |
| getKey: (x: X) => K, | |
| xs: readonly X[], | |
| ): { readonly [k in K]?: readonly (X | undefined)[] } => { | |
| const grouped: { [k in K]?: (X | undefined)[] } = {}; | |
| for (const x of xs) { | |
| const key = getKey(x); | |
| grouped[key] ??= []; | |
| // we have initialised ^ so grouped[key] won't be undefined |
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
| <script lang="ts"> | |
| import { computed, PropType, defineComponent } from 'vue'; | |
| import { RouterLink, useLink } from 'vue-router'; | |
| import type { RouterLinkProps } from 'vue-router'; | |
| declare module 'vue-router' { | |
| interface _RouterLinkI { | |
| props: { | |
| [k in keyof RouterLinkProps]-?: { | |
| type: PropType<RouterLinkProps[k]>; |
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
| const routes = [ | |
| { | |
| path: '/', | |
| element: <App />, | |
| errorElement: <CircularProgress />, | |
| children: [ | |
| { | |
| index: true, | |
| element: <LandingPage />, | |
| }, |
This is an on-going list of things that I constantly find missing in Safari, (and possibly ways to work around them)
I cannot believe my eyes when positive/negative lookbehind is still not available on safari. Here is how you can work around it:
Instead of