Skip to content

Instantly share code, notes, and snippets.

View Be1zebub's full-sized avatar
🚀
gmod.one/discord

Beelzebub Be1zebub

🚀
gmod.one/discord
View GitHub Profile
const { buf } = require("crc-32");
const { readFile, stat } = require("fs").promises;
const { createWriteStream } = require("fs");
const addon_data = JSON.stringify(require("./addon.json"));
class GMAFile {
constructor(fname) {
this.stream = createWriteStream(fname);
this.current_length = 8; // crc32 + 0 (uint)
@AMD-NICK
AMD-NICK / petrovich.lua
Created June 20, 2020 18:32
Функция для Garry's Mod, склоняющая русские слова (винительный, дательный и тд..). Тамада - тамаду/тамаде/тамадой и тд. Использует правила с github.com/petrovich. В текущей реализации хромает качество исполнения, но скрипт работает. Специально для t.me/gmodev
--[[-------------------------------------------------------------------------
2019.01.16
Урезанный класс для склонения русских слов
https://github.com/petrovich/petrovich-php
В оригинале работает с именами
Полезные ссылки:
https://petroleks.ru/gramota/13.php
https://pymorphy2.readthedocs.io/en/latest/
AddCSLuaFile()
do -- override type functions
gtype = type
local getmetatable = getmetatable
local rawequal = rawequal
getmetatable("").MetaName = "string"
-- Define a dotenv object
local dotenv = {}
-- Define a function to read a file and return its contents as a string
local function readFile(filename)
-- Open the file in read mode
local file = io.open(filename, 'r')
-- Check if the file exists
if not file then
-- Return nil and an error message
@blueshank-gh
blueshank-gh / interserve.lua
Last active August 4, 2025 02:29
Interserve - Initial Concept Version
--[[
Interserve - Abusing HTTP to get around net.* limits.
Initial Concept Version, do not use on production servers.
Contact: https://github.com/eprosync
Prerequisite: https://github.com/eprosync/interstellar_gmod
]]
local interserve = {}
_G.interserve = interserve
-- https://github.com/Stepets/utf8.lua
-- $Id: utf8.lua 179 2009-04-03 18:10:03Z pasta $
--
-- Provides UTF-8 aware string functions implemented in pure lua:
-- * utf8len(s)
-- * utf8sub(s, i, j)
-- * utf8reverse(s)
-- * utf8char(unicode)
-- * utf8unicode(s, i, j)
-- * utf8gensub(s, sub_len)
// ==UserScript==
// @name Spotify ad skipper
// @version 1.0
// @namespace http://tampermonkey.net/
// @description Detects and skips ads on spotify
// @match https://*.spotify.com/*
// @grant none
// @run-at document-start
// @downloadURL https://gist.githubusercontent.com/Simonwep/24f8cdcd6d32d86e929004013bd660ae/raw
// @updateURL https://gist.githubusercontent.com/Simonwep/24f8cdcd6d32d86e929004013bd660ae/raw
@wojteklu
wojteklu / clean_code.md
Last active July 16, 2026 13:23
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@Earu
Earu / gmod_nsfw_classifier.lua
Created July 18, 2026 16:38
A PoC that aims at classifying images on whether they contain NSFW / gore material.
--[[-----------------------------------------------------------------------------
Client-side NSFW / gore image classifier for Garry's Mod
Runs an ONNX image-safety model locally inside a hidden DHTML via onnxruntime-web.
`Classify(url, cb)` -> cb(status), where status is:
STATUS_SAFE safe
STATUS_UNCERTAIN borderline, or we couldn't classify it
STATUS_NSFW nudity or gore