Skip to content

Instantly share code, notes, and snippets.

View Gethe's full-sized avatar

Tim West Gethe

  • Philadelphia, PA
View GitHub Profile
@Gethe
Gethe / GetCooldownLeft.lua
Created October 14, 2020 03:56
GetCooldownLeft
--[[
Returns the true cooldown of an ability or item, correcting for https://github.com/Stanzilla/WoWUIBugs/issues/47
Credit to Eliote and Arkoniel in the WoW Addons discord
]]
local function GetCooldownLeft(start, duration)
if start < GetTime() then
local cdEndTime = start + duration
local cdLeftDuration = cdEndTime - GetTime()
@Gethe
Gethe / pre-commit
Last active September 6, 2020 04:52
pre-commit Luacheck
#!/bin/bash
# based on https://gist.github.com/dahjelle/8ddedf0aebd488208a9a7c829f19b9e8
exitCode=
for file in $(git diff --cached --name-only | grep -E '\.lua$'); do
# we only want to check the staged changes, not any un-staged changes
if [[ -f "$file" ]]; then
luacheck "$file" --formatter plain
fi
local WOWDIR = "E:/World of Warcraft"
local CDN = "http://us.patch.battle.net:1119/wow/#us"
local FILE = "DBFilesClient/ManifestInterfaceData.db2"
local casc, dbc = require("casc"), require("dbc")
local conf = {
base = WOWDIR .. "/data",
locale = casc.locale.US,
verifyHashes = false,
@Gethe
Gethe / NineSliceError.lua
Created December 12, 2018 17:08
NineSlice error
x1 SharedXML\NineSlice.lua:70: Attempt to access forbidden object from code tainted by an AddOn
Stack: [C] in function 'CreateTexture'
SharedXML\NineSlice.lua:70: in function <SharedXML\NineSlice.lua:62>
SharedXML\NineSlice.lua:150: in function 'ApplyNineSliceLayout'
SharedXML\PanelThemes.lua:118: in function <SharedXML\PanelThemes.lua:115>
Time: 2018/12/12 11:05:15 Index: 1/1
RealUI Version: 2.0.6
Locals:
(*temporary) = <unnamed> {
0 = <userdata>
@Gethe
Gethe / symlink.ps1
Last active April 6, 2023 20:05
Create symlinks for RealUI project folder
local casc = require("casc")
casc.GetImpl()
local filter, root = {} do
local code = arg[1] == 'code' or arg[1] == 'both' or arg[1] == nil
local art = arg[1] == 'art' or arg[1] == 'both'
root = "BlizzardInterface" .. (code and "Code" or art and "Art")
filter.xml, filter.lua, filter.toc, filter.xsd = code, code, code, code
filter.blp = art
end