Attention: if you attempt to fork this gist, github will think that you are a spammer and you will have to confirm that you are human with them. Apparantly there are too many links in this list. Also I update it rather frequently (see revisions on the left), so it's probably wise to not fork it anyway.
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
/* ADOPTED FROM | |
https://github.com/InfiniteLee/ammo-debug-drawer | |
*/ | |
import Ammo from "ammo.js" | |
export const DefaultBufferSize = 3 * 1000000 | |
export const AmmoDebugConstants = { | |
NoDebug: 0, |
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
/** | |
* The MIT License | |
* | |
* Copyright © 2022 Yuka authors | |
* | |
* 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 |
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
const { vec3, vec4, mat4, quat } = window.glMatrix | |
var { ModelViewer, handlers, Scene, Camera } = ModelViewer.default.viewer | |
// shim methods and variables for custom mdx methods | |
// taken from https://github.com/d07RiV/wc3data/blob/master/src/mdx/viewer/camera.js | |
let vectorHeap = vec3.create(); | |
let vectorHeap2 = vec3.create(); | |
let vectorHeap3 = vec3.create(); | |
let quatHeap = quat.create(); |
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
/* | |
Changes made from where I left off in the hacker rank challenge- | |
1. fix typo: "seen[to].p = getNode(from, null, seen[to]);" -> "seen[to].parent = getNode(from, null, seen[to]);" | |
2. fix typo: "seen[from] = seen[to].p;" -> "seen[from] = seen[to].parent;" | |
3. fix typo: "seen[to] = seen[from.child];" -> "seen[to] = seen[from].child;" | |
4. add third condition block - where (seen[to] && seen[from]) evaluates to true - to deal with | |
linking together the disjoint linked lists | |
5. fill in both traversing helper methods | |
*/ |
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
var str0 = `<div>\n<span>\n</div>\n</span>\n`; //expected false | |
var str1 = `<div>\n<span>\n</span>\n</div>\n</span>\n` //expected false | |
var str2 = `<div>\n<span>\n</span>\n</div>\n<span>\n`//expected false | |
var str3 = `<div>\n<span>\n</span>\n</div>\n` //expected true | |
var str4 = `<div>\n</div>\n`; //expected true | |
var str5 = `<div>\n</div>\n<span>\n</span>\n`; //expected true | |
var str6 = `<span>\n<div>\n</div>\n<span>\n</span>\n</span>\n`; //expected true | |
//nice short solution using a stack | |
function getType(tag) { |