Skip to content

Instantly share code, notes, and snippets.

CREATE DATABASE jpworgen;
CREATE TABLE IF NOT EXISTS jpworgen.ActiveItems
(
UpdateTime DateTime('UTC') CODEC (DoubleDelta),
ScanTime DateTime('UTC'),
RealmId UInt16,
Namespace LowCardinality(String),
Faction Enum8('Alliance' = 0, 'Horde' = 1),
AuctionId UInt32,
@Meorawr
Meorawr / PrivateAuras_AuraAnchorExample.lua
Created March 31, 2023 20:59
Private Auras API Examples
-- This example will configure an anchor to display the first private aura that
-- gets applied to the player.
--
-- Multiple calls for the same aura index can be made. This will in effect
-- create multiple distinct displays for the same aura index.
local AuraFrame1 = CreateFrame("Frame", UIParent);
AuraFrame1:SetPoint("CENTER");
AuraFrame1:SetSize(48, 48);
@pudquick
pudquick / brew.md
Last active November 7, 2024 11:03
Lightly "sandboxed" homebrew on macOS

brew is a bad neighbor

This isn't a guide about locking down homebrew so that it can't touch the rest of your system security-wise.

This guide doesn't fix the inherent security issues of a package management system that will literally yell at you if you try to do something about "huh, maybe it's not great my executables are writeable by my account without requiring authorization first".

But it absolutely is a guide about shoving it into its own little corner so that you can take it or leave it as you see fit, instead of just letting the project do what it likes like completely taking over permissions and ownership of a directory that might be in use by other software on your Mac and stomping all over their contents.

By following this guide you will:

  • Never have to run sudo to forcefully change permissions of some directory to be owned by your account
@yakatz
yakatz / example_usage.pp
Created May 25, 2022 15:44
Manage System Git Config with Puppet
class myweb::sites::wiki_example_com {
wiki_base = '/var/www/sites/wiki.example.com'
include ::profile::gitconfig
profile::gitconfig::safe_directory {"${wiki_base}/code/mediawiki-1.35-LTS":}
vcsrepo { "${wiki_base}/code/mediawiki-1.35-LTS/":
ensure => latest,
provider => git,
source => '[email protected]:wiki/mediawiki-1.35-LTS.git',
@anuraghazra
anuraghazra / readme.md
Last active March 21, 2023 21:06
TypeScript TokenizeTheme type performance

In these two files if you change getToken{slow,fast}'s passed value (just add a random letter anywhere) you'll see that the fast version is getting type checked about 3x to 5x faster than the slow one.

I'm not sure why using key remapping and using keyof {} is about 3x to 5x faster when doing type checking.

My guess is that in the slow version is using index access with the {}[keyof Theme] which is generally slower?

A metatable can be defined like

local t = setmetatable({}, {
  __tostring = function() return 'custom tostring behavior!' end
})

Here are the metamethods that you can define, and their behavior

Operators

@johnpapa
johnpapa / existing.js
Last active May 1, 2021 08:37
Our idea for simpler template code
module.exports = async function (context, req) {
context.log('JavaScript HTTP trigger function processed a request.');
const name = (req.query.name || (req.body && req.body.name));
const responseMessage = name
? "Hello, " + name + ". This HTTP triggered function executed successfully."
: "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response.";
context.res = {
// status: 200, /* Defaults to 200 */
@connor4312
connor4312 / readme.md
Last active May 1, 2021 09:27
Test API

Requirements

  1. Load tests asynchronously, and gradually (pull from extension)
  2. Listen to test changes, new children, and removal of children (push from extension)
  3. Be able to place tests in the tree concurrently with a test run as results are reported (push from extension)
  4. Be able to stop listening to tests from a child
  5. Allow the extension to identity its tests in whatever "run test" mechanism there is

Approaches

@Meorawr
Meorawr / GTT_CreatureInspect.lua
Last active August 30, 2024 20:23
Creature Spawn Inspector
--
-- Creature GUID Inspector
--
function GTT_CreatureInspect(self)
local _, unit = self:GetUnit();
local guid = UnitGUID(unit or "none");
local prefix = string.match(guid, "^([CVP][^l][^-]+)");
if not guid or not prefix then
@Wetxius
Wetxius / ObjectiveTracker.lua
Created November 25, 2020 14:51
ShestakUI\Modules\Quests\ObjectiveTracker.lua
local T, C, L, _ = unpack(select(2, ...))
----------------------------------------------------------------------------------------
-- Move ObjectiveTrackerFrame and hide background
----------------------------------------------------------------------------------------
local frame = CreateFrame("Frame", "ObjectiveTrackerAnchor", UIParent)
frame:SetPoint(unpack(C.position.quest))
frame:SetSize(224, 150)
ObjectiveTrackerFrame:ClearAllPoints()