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 function pureObject(o: unknown) { | |
| if (!isObject(o)) return false | |
| const ctor = o.constructor | |
| if (ctor == null) return true | |
| const prot = ctor.prototype | |
| if (!isObject(prot)) return false | |
| if (!Object.prototype.hasOwnProperty.call(prot, 'isPrototypeOf')) return false |
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
| declare module wx { | |
| module cloud { | |
| function downloadFile(opts: Callback<{ | |
| fileID: string | |
| config?: { | |
| env: string | |
| } | |
| success: (opts: { | |
| tempFilePath: string | |
| }) => void |
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 {prototype: {toString}, keys} = Object | |
| const a = { | |
| name: 'JetLu', | |
| other: {age: 12, gender: 0, alias: 2} | |
| } | |
| const b = { | |
| name: 'JetLu', | |
| other: {age: 12, gender: 0, alias: 2} |
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
| #define NUM_OCTAVES 3 | |
| precision highp float; | |
| varying vec2 vTextureCoord; | |
| uniform sampler2D uSampler; | |
| uniform vec4 inputSize; | |
| uniform float t; |
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
| /*** | |
| * ┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐ | |
| * │Esc│ │ F1│ F2│ F3│ F4│ │ F5│ F6│ F7│ F8│ │ F9│F10│F11│F12│ │P/S│S L│P/B│ ┌┐ ┌┐ ┌┐ | |
| * └───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ └┘ └┘ └┘ | |
| * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ ┌───┬───┬───┬───┐ | |
| * │~ `│! 1│@ 2│# 3│$ 4│% 5│^ 6│& 7│* 8│( 9│) 0│_ -│+ =│ BacSp │ │Ins│Hom│PUp│ │N L│ / │ * │ - │ | |
| * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ ├───┼───┼───┼───┤ | |
| * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │{ [│} ]│ | \ │ │Del│End│PDn│ │ 7 │ 8 │ 9 │ │ | |
| * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ ├───┼───┼───┤ + │ | |
| * │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │: ;│" '│ Enter │ │ 4 │ 5 │ 6 │ │ |
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
| let seed = 1 | |
| function seededRandom(max = 1, min = 0) { | |
| seed = (seed * 9301 + 49297) % 233280; | |
| let rnd = seed / 233280.0; | |
| return min + rnd * (max - min); |
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
| function sort<T>(list: Array<T>, cmp?: (a: T, b: T) => number) { | |
| const {length} = list | |
| if (length < 2) return list | |
| cmp ??= (x, y) => (x as unknown as number) - (y as unknown as number) | |
| let unit = 1 | |
| let results = [] as Array<T> | |
| while (length > unit) { |
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 default class Layout extends PIXI.Container { | |
| static GRID = 2 | |
| static VERTICAL = 1 | |
| static HORIZONTAL = 0 | |
| #added = false | |
| constructor(option = {}) { | |
| const { | |
| gap, |
NewerOlder