Skip to content

Instantly share code, notes, and snippets.

@jednano
jednano / gitcom.md
Last active September 21, 2024 23:12
Common git commands in a day-to-day workflow

Git Cheat Sheet

Initial Setup

Create an empty git repo or reinitialize an existing one

git init
@inmatarian
inmatarian / lzw.lua
Created December 27, 2014 02:14
LZW Compression in Lua, rosetta-code style, also includes a 8-bit only mode for 7bit plain text strings.
local lzw = {}
local function enc_reset(dict, size)
for k, _ in pairs(dict) do dict[k] = nil end
for i = 0, size-1 do dict[string.char(i)] = i end
return dict
end
local function dec_reset(dict, size)
for k, _ in pairs(dict) do dict[k] = nil end