Skip to content

Instantly share code, notes, and snippets.

@CaptainPRICE
CaptainPRICE / int32.lua
Last active December 18, 2019 08:49
struct int32 for Lua.
local math = math
local math_floor = math.floor
local error, setmetatable, rawget, tostring, type = error, setmetatable, rawget, tostring, type
int = {}
do
local INT32, INT32_NAME, INT32_SIZE, INT32_DEFAULT, INT32_MAX, INT32_MIN = 3, "int32", 32, 0, 2147483648, -2147483648
local int32 = {
__metatable = false,
@mjallday
mjallday / redisbuffer.py
Created October 31, 2012 17:06
Redis Circular Buffer
class RedisCircularBuffer(object):
def __init__(self, namespace, size):
self.namespace = namespace
self.size = size
import redis
self.redis = redis.Redis()
def append(self, item):
self.redis.lpush(self.namespace, item)