Skip to content

Instantly share code, notes, and snippets.

View Kruithne's full-sized avatar
🚀
Go as far as you can take it

Kruithne Kruithne

🚀
Go as far as you can take it
View GitHub Profile
@Kruithne
Kruithne / gist:1093fc49678df1feb6a6b2c7df3d9f02
Last active April 30, 2023 20:34
Primitive array benchmark
let arr;
let foo = {};
// Category A: Pre-determined array size with index assignment
console.log("Pre-determined array size with index assignment");
console.log("%cSize | Time (ms)", "font-weight: bold");
for (let x of [1000, 1001, 10000, 10001, 100000, 100001, 10_000_000, 10_000_001]) {
const iterations = 10; // number of times to run the test
const start = performance.now();
for (let i = 0; i < iterations; i++) {
@Kruithne
Kruithne / glasses.lua
Created April 13, 2021 23:56
Glasses
/run a=function(x,y)DEFAULT_CHAT_FRAME:AddMessage("\124cffffffff\124Hitem:"..x..":::::::::::::\124h["..y.."]\124h\124r");end;a(186092,"Half-Rim Reading Glasses");a(186093,"Hipster Shades");a(186090,"Black Rimmed Spectacles");a(186091,"Muscisian's Shades")
@Kruithne
Kruithne / tile_merge.js
Created December 2, 2020 01:42
Tile Merge script for wow.export
// Tile Merge Script by Kruithne
// Disclaimer: This was written for a very specific purpose and comes with no warranty.
// If this explodes, ping @Kruithne in Party Tortollans Discord (wow.export channel).
// If this teleports your dog into the vacuum of space, please do not contact me.
// Before Usage:
// - Make sure you have Node v15.3.0+ installed (https://nodejs.org/en/)
// Usage:
// 1) Copy the contents of this script to a file called 'tile_merge.js'
@Kruithne
Kruithne / gist:8d472e944f233fa5bb1b861fcd275582
Last active December 6, 2019 15:05
Clunky MDX converter
// WARNING - This was written in a rush, late at night. Mostly broken, not good code.
// UV mappings are slightly wrong, scale Y -1 to fix.
// Requires modded Bufo found here -> https://gist.github.com/Kruithne/679eb3b3e5099360cbe4c5872f2aa606
// Only exports Verts, Faces, UV and Normals to OBJ format (no MTL, skin it yourself!)
const fs = require('fs');
const Bufo = require('./bufo.js');
const path = require('path');
const util = require('util');
const argv = process.argv.splice(2);
@Kruithne
Kruithne / bufo.js
Created October 12, 2019 23:34
Bufo modded
/*!
Bufo (https://github.com/Kruithne/node-bufo)
Author: Kruithne <kruithne@gmail.com>
License: MIT
*/
const ENDIAN_LITTLE = 0x0;
const ENDIAN_BIG = 0x1;
const TYPE_BUFFER = 0x0;
@Kruithne
Kruithne / import.py
Created March 12, 2019 22:31
WIP fast import script
import bpy
import bmesh
objectFile = "D:\\WoWExport\\world\\wmo\\draenor\\human\\6hu_garrison_inn_v1.obj"
verts = []
normals = []
uv = []
faces = []
material_libs = set()
@Kruithne
Kruithne / hash.php
Created March 10, 2017 02:54
Hashing Script
<?php
echo PHP_EOL;
// Command information, used by showHelp().
$commands = [
'-h' => 'Display this list of parameters.',
'-l' => 'List available hashing methods.',
'-m' => 'Select hashing method (Required).',
'-f' => 'Treat input as a file path.',
'-n' => 'Split input by line-end, hashing each line.',
@Kruithne
Kruithne / constructor.js
Created January 24, 2017 09:29
Mini jQuery object constructor
renderObject = (target) => {
var elem = $(target.tag || "<div/>");
for (var prop in target) {
if (!target.hasOwnProperty(prop))
continue;
if (prop == "tag")
continue;
@Kruithne
Kruithne / rmrf.php
Created January 12, 2017 16:04
Recursive PHP File Deleteion
function rmrf($dir)
{
foreach (scandir($dir) as $node)
{
if ($node == "." || $node == "..")
continue;
$path = $dir . DIRECTORY_SEPARATOR . $node;
if (is_dir($path))
rmrf($path); // Directory, explore deeper.
One of the adverts* currently being served on wowhead.com attempts to hi-jack the users current tab/window and redirect them to another site** which appears to be an attempt at phising.
* Target ad:
http://pop.frvmedia.com/?utm_term=22056182916&clickverify=1&utm_content=fdc2c69f9aaf9cad90969691a69690958abb88b9cbd1d8d8d4daded4d2b7c1dbeeeeeee0e0eae88db2df
** Hi-jack destinations:
http://nhqzz.reward-zone.7113735.com/?sov=38518760&hid=bhnnfdnhjlhldjdj&&nopop=1&noalert=1&redid=11551&gsid=22&campaign_id=20&id=XNSX.22056182916%3A%3A%3A%3A3167-r11551-t22
http://survey.7113659.com/?sov=3722390254&id=XNSX.22056961043::::3167-r16523-t68-&hid=bjdfdljbpfjlhldjdj&tov=410216&v=&alertforce=&mov=nr.ytsurvey.mini&redid=16523&redid=16523&campaign_id=29&gsid=68&noexpand=1&noalert=1&audio=1&nopop=1