Skip to content

Instantly share code, notes, and snippets.

@jhseodev
jhseodev / luaF.c
Last active March 11, 2021 23:57 — forked from jarcode-foss/luaF.c
fast split function for Lua
// Faster split method, the only alternative within lua is using gsub, which
// is insanely slower. This function will actually return strings on the stack,
// so {str:split(d)} can be used to collect the return values in a table
//
// A more memory effecient use would be to use string.fsplit rather than using
// a table construct
//
// this avoids extra memory bloat and will keep the resulting strings on the stack
//
// Build:
@jhseodev
jhseodev / epoll_server.py
Created October 25, 2022 23:55 — forked from dtoma/epoll_server.py
epoll tcp server in python
#!/usr/bin/env python
"""Simple server using epoll."""
from __future__ import print_function
from contextlib import contextmanager
import socket
import select