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
| window.TimeLord = (function(){ | |
| /* | |
| # Time accounted for | |
| Date.now() | |
| window.performance.now() | |
| window.setInterval(...) | |
| window.setTimeout(...) | |
| window.requestAnimationFrame(...) | |
| # Not accounted for |
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(URL, parent){ | |
| var initialConstructor = parent.URL; | |
| var urlPattern = new RegExp( | |
| "^" + | |
| //protocol | |
| "(?:((?:\\w+):)?/?/?)" + | |
| //user:pass | |
| "(?:(?:([^:]*)(?::([^@]*))?)?@)?" + |
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
| import haxe.macro.Context; | |
| import haxe.macro.Expr; | |
| import haxe.macro.TypeTools; | |
| #if !macro | |
| @:genericBuild(PartialMacro.build()) | |
| #end | |
| class Partial<T> {} | |
| class PartialMacro { |
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
| package; | |
| import haxe.io.Bytes; | |
| import haxe.io.Input; | |
| @:enum abstract DDSD(UInt) to UInt{ | |
| var CAPS = 0x1; | |
| var HEIGHT = 0x2; | |
| var WIDTH = 0x4; | |
| var PITCH = 0x8; |
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
| /* | |
| Incomplete parser for closure compiler externs | |
| Converts closure externs to haxe classes and modules | |
| Tested using https://github.com/nodebox/opentype.js/tree/master/externs | |
| https://github.com/google/closure-compiler/wiki | |
| */ | |
| class ClosureExternConverter { |
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
| // analyitc spring integration | |
| // useful when you want a robust single-spring simulation | |
| stepSpring( | |
| dt_s: number, | |
| state: { | |
| x: number, | |
| v: number, | |
| pe: number, // potential energy | |
| }, parameters: { | |
| tension: 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
| /** | |
| * # GFF3 File format | |
| * https://github.com/The-Sequence-Ontology/Specifications/blob/master/gff3.md | |
| */ | |
| export type LineCallbacks = { | |
| // directives | |
| onVersion: (versionString: string) => void, | |
| onSequenceRegion: (seqId: string | null, start: number | null, end: number | null) => void, | |
| onFeatureOntology: (uri: 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
| function getType(x) { | |
| let type = typeof x; | |
| if (type === 'object') { | |
| if (Array.isArray(x)) { | |
| return `Array<${getType(x[0])}>`; | |
| } else { | |
| let fields = []; | |
| for (let key of Object.keys(x)) { | |
| fields.push(`${key}: ${getType(x[key])}`); | |
| } |
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
| /* | |
| * Copyright (C)2005-2018 Haxe Foundation | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a | |
| * copy of this software and associated documentation files (the "Software"), | |
| * to deal in the Software without restriction, including without limitation | |
| * the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
| * and/or sell copies of the Software, and to permit persons to whom the | |
| * Software is furnished to do so, subject to the following conditions: | |
| * |
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
| /* | |
| * Copyright (C)2005-2018 Haxe Foundation | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a | |
| * copy of this software and associated documentation files (the "Software"), | |
| * to deal in the Software without restriction, including without limitation | |
| * the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
| * and/or sell copies of the Software, and to permit persons to whom the | |
| * Software is furnished to do so, subject to the following conditions: | |
| * |