Skip to content

Instantly share code, notes, and snippets.

View TerenceZ's full-sized avatar

terencez TerenceZ

  • Guangzhou, China
View GitHub Profile
@TerenceZ
TerenceZ / optional.ts
Last active April 30, 2019 02:04
make some record items optional if match
type Optional<T> = { [K in keyof T]?: T[K] }
type UnionToIntersection<U> = (U extends any
? (k: U) => void
: never) extends ((k: infer I) => void)
? I
: never
type OptionalIfMatch<T, C, R> = T extends C ? Optional<R> : R
type OptionalIfNotMatch<T, C, R> = T extends C ? R : Optional<R>
@TerenceZ
TerenceZ / vue.jsx.d.ts
Last active April 24, 2019 08:00
JSX Definition for Vue
// This is jsx definition for vue modified from @types/react.d.ts for [email protected].
// based on @types/react
import * as CSS from 'csstype'
import Vue, { VNode, VNodeChildren } from 'vue'
declare module 'vue/types/vue' {
export interface Vue {
__jsxProps: any
}

Sakura Animation using WebGl

Sakura animation using WebGL. No images are used. The framerate might be slow or the demo might not play at all in some older systems so you can watch this video: http://www.screenr.com/BFZ8. Let me make it clear that I did not make this and just thought is was very cool and wanted to share it.

A Pen by Frank FitzGerald on CodePen.

License.