Skip to content

Instantly share code, notes, and snippets.

View deitrix's full-sized avatar

Big Phil deitrix

View GitHub Profile
@deitrix
deitrix / timer.gsc
Created December 17, 2025 13:38
Black Ops II Zombies Game/Round Timers & Zombies Count
#include maps\mp\_utility;
#include common_scripts\utility;
#include maps\mp\gametypes_zm\_hud_util;
#include maps\mp\zombies\_zm_utility;
init()
{
level thread on_player_connect();
}
@deitrix
deitrix / ScrollControl.ahk
Last active December 22, 2025 02:59
Volume and Twinkle Tray with mouse scroll
#Requires AutoHotkey v2.0
#SingleInstance Force
; --- Configuration ---
DebounceTime := 200
LastBackUp := 0
LastForwardUp := 0
; --- 1. BACK BUTTON (XButton1) - Volume ---
; Holding mouse back and scrolling adjusts volume
@deitrix
deitrix / gen.go
Last active April 18, 2025 22:04
Concurrent processing of a large CSV file
package main
import (
"encoding/csv"
"math/rand"
"os"
"strconv"
)
const numRecords = 1_000_000
package main
import (
"context"
"database/sql"
"encoding/json"
"fmt"
"net/http"
"os"
"path/filepath"
@deitrix
deitrix / template_test.go
Last active May 30, 2023 16:03
Test cases for Luna
package main
import (
"bytes"
"strings"
"testing"
"text/template"
)
type Data struct {
@deitrix
deitrix / script.lua
Last active May 23, 2023 20:36
Redis/Lua Leaky-bucket Rate Limit
-- Input parameters
local tokens_key = KEYS[1]..":tokens" -- Key for the bucket's token counter
local last_access_key = KEYS[1]..":last_access" -- Key for the bucket's last access time
local capacity = tonumber(ARGV[1]) -- Maximum number of tokens in the bucket
local rate = tonumber(ARGV[2]) -- Rate of token generation (tokens/second)
local now = tonumber(ARGV[3]) -- Current timestamp in microseconds
local requested = tonumber(ARGV[4]) -- Number of tokens requested for the operation
-- Fetch the current token count