Skip to content

Instantly share code, notes, and snippets.

View SoniEx2's full-sized avatar

Soni L. SoniEx2

View GitHub Profile
@SoniEx2
SoniEx2 / list_of_mod_makers_breaking_curse_tos.md
Last active August 27, 2016 02:11
List of mod makers breaking Curse's TOS

List of mod makers breaking Curse's TOS

Note: This list is incomplete. It'll be expanded as time goes on. Feel free to comment below with a link to your Curse profile to help me expand the list.

So apparently Curse has this ridiculous term on their TOS (archived at the time of making this gist):

In order to access some features of the Websites, you will have to create an account. You must be at least 18 years of age to register an account. Minor children may only access account-related features using a parent or guardian’s account so long as the

@SoniEx2
SoniEx2 / 52emu.lua
Created September 26, 2015 19:05 — forked from katlogic/52emu.lua
local track={}
setmetatable(track,{__mode="v"})
function setmetatable52(t,mt)
if mt.__gc then
local p = newproxy(true)
track[p] = t
getmetatable(p).__gc = function(p)
local mt = debug.getmetatable(t)
if mt and rawget(mt, "__gc") then
rawget(mt, "__gc")(t)
@SoniEx2
SoniEx2 / andif.md
Last active September 18, 2015 03:44

The andif Idea

[I might throw this one out. Scroll down for the orif idea]

Trivial use-case

Sometimes when you're coding you end up with things like this:

@SoniEx2
SoniEx2 / Abstract Enums.md
Created May 4, 2015 00:54
Abstract Enums

Hello,

I'd like to talk about abstract enums. In Java, you have enums:

public enum MyEnum {
    MY_ENUM_VALUE,
    MY_OTHER_ENUM_VALUE;
}
@SoniEx2
SoniEx2 / Makefile
Created April 4, 2015 14:48
liolib.lua, JIT-able reimplementation of Lua's I/O library. MIT license.
# This makefile is so we can extract some #define's from the C library, as LuaJIT has no way of exposing those #define's.
# Just run `make liolib.lua`.
LIOLIBC= int SEXIO_IOFBF = _IOFBF; \
int SEXIO_IOLBF = _IOLBF; \
int SEXIO_IONBF = _IONBF; \
int SEXIO_SEEK_SET = SEEK_SET; \
int SEXIO_SEEK_CUR = SEEK_CUR; \
int SEXIO_SEEK_END = SEEK_END;
@SoniEx2
SoniEx2 / clex.md
Last active December 18, 2016 02:31

ClEx - Clunky Expressions

Version 0.10.

Authors:

  • SoniEx2

About

MPNGPNG - Mutli-PNG PNG spec

MPNGPNG v0.22

Authors:

-- JIT It, the thing that makes LuaJIT JIT.
do
-- get the registry table
local registry = debug.getregistry();
-- replace debug.getregistry with a JIT-able (pure-Lua) version.
debug.getregistry = function() return registry end
end

CTCP COLOR

CTCP COLOR is a CTCP ACTION-like CTCP, but instead of providing a different message style, it provides different colors.

Let:

X-DELIM ::= '\x01'
SPACE ::= ' '
--[[ pastebin didn't like me so I'm moving it here ]]
--[[ code used to make Shocky run this remote file
.r sonilua <lua>local function runpage(pageurl) local page,f,l; page = {net.get(pageurl)}; f=loadstring(page[1]); l = {}; for k,v in pairs(_G) do l[k] = v; end; for k,v in pairs(getfenv()) do l[k] = v; end; setfenv(f,l); return f(); end; return runpage("https://gist.githubusercontent.com/SoniEx2/f392c77ae81032bc295e/raw/sonilua.lua");
--]]
--[[
This is public domain btw
--]]
if (not args) or (args == "") then