Skip to content

Instantly share code, notes, and snippets.

View groverburger's full-sized avatar

Zach groverburger

View GitHub Profile
@groverburger
groverburger / rocketjump.js
Last active January 25, 2023 08:43
Simple and fast immediate mode HTML gui rendering
let renderStack
let cache
function htmlify (what) {
if (!Array.isArray(what)) {
return what
}
const tagDef = typeof what[0] === 'string' ? what[0] : what[0].tag
const [tag, ...modifiers] = tagDef.split(' ')
@groverburger
groverburger / init.el
Last active January 2, 2024 04:46
My personal Emacs config file
(setq custom-file (concat user-emacs-directory "auto-custom.el"))
(setq byte-compile-warnings '((not cl-functions)))
;(load custom-file 'noerror)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; set up and make sure packages are installed
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq package-archives
'(("melpa" . "https://melpa.org/packages/")
@groverburger
groverburger / lualisp.lua
Created October 12, 2021 00:35
A tiny lisp implemented in Lua
io.stdout:setvbuf("no")
-- turns an input string into a list of tokens
-- where tokens are strings
function tokenize(input)
local result = {}
local token = ""
local inString = false
for i=1, #input do
return function (address)
local query = nil
-- check if windows or not windows
if package.config:sub(1,1) == "\\" then
-- TODO fix the annoying cmd window that pops up here
query = io.popen("powershell (wget " .. address .. ").Content", "r")
else
-- not windows, assuming posix
query = io.popen("curl -s '" .. address .. "'", "r")
" blackjack colorscheme
" created by groverburger sometime in 2020
" MIT license
" let and set up the colors
if (has("gui_running"))
let s:background = "#191919"
let s:foldedBackground = "#303030"
let s:white = "#cccccc"
let s:normal = "#a0a0a0"
@groverburger
groverburger / build.lua
Last active April 29, 2023 21:16
a file to automate the build process for love2d games and applications on posix systems
----------------------------------------------------------------------------------------------------------------
--
-- groverburger's love2d game build script for macos
-- windows and mac export are currently supported
--
----------------------------------------------------------------------------------------------------------------
--
-- basic usage:
--
-- put this file in the same directory as your main.lua file
-- client.lua
local enet = require "enet"
local host = enet.host_create()
local server = host:connect("127.0.0.1:6789")
function love.update(dt)
-- gets an event, if it exists
local event = host:service(100)
while event do
if event.type == "receive" then
local socket = require "socket"
function love.load()
udp = socket.udp()
Setup = false
Thing = "n/a"
Input = ""
love.keyboard.setKeyRepeat(true)
end
@groverburger
groverburger / sha256.lua
Last active October 12, 2019 21:56
SHA256 implementation in pure Lua: clean, readable, and commented
Bit32 = require "bit"
K_CONSTANTS = {
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,