Skip to content

Instantly share code, notes, and snippets.

View drhayes's full-sized avatar
🐱

David Hayes drhayes

🐱
View GitHub Profile
@1bardesign
1bardesign / ecs_writeup.md
Last active June 2, 2020 13:42
Hopefully straightforward writeup on the design of my lua-side "ecs", which I should find a better name for.

Components:

  • Managed by systems, self-contained as much as possible
  • May have references to components in other systems that they're dependent on (eg a sprite might want a position, though it may accept any vector (shared or unshared) for that position)
  • Generally take those references in their constructor
  • Generally designed to have a nice oop-y method interface, rather than be "just" data - eg sprite:set_frame(fx, fy), animation:reset() etc

Systems:

  • Do stuff with their set of components
@arachonteur
arachonteur / rexpaint.lua
Created March 16, 2019 16:09
A lightweight REXPaint .xp file reader for LOVE2D.
--
-- A lightweight REXPaint .xp reader for LOVE2D.
-- By Vriska Serket / @arachonteur
--
-- Output table looks like this.
--[[
{
version = 0,
layerCount = 0,
layers = {
@josefnpat
josefnpat / slider.lua
Created October 10, 2018 19:30
Slider Library
--[[
Copyright (c) 2018, Josef Patoprsty
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
@pablomayobre
pablomayobre / steady.lua
Last active May 22, 2020 07:37
Fixed time step love.run
--MIT License
--Copyright (c) 2019 Arvid Gerstmann, Jake Besworth, Max Cahill, Pablo Mayobre, LÖVE Developers
--Original author: https://github.com/Leandros
--Max frame skip: https://github.com/jakebesworth
--Manual garbage collection: https://github.com/Geti
--Put it all together: https://github.com/Positive07
--Original love.run: LÖVE Developers
local conf = {
@pablomayobre
pablomayobre / batch.lua
Last active December 22, 2018 01:11
Perform many removal, inserting operations on a table, fast!
local batch = {}
local holes_err = "bad argument #%s to function '%s' (this list doesn't support holes)"
local refill = function (t, ...)
local newn = select('#', ...)
local length = math.max(newn, (t.n or #t))
for i = 1, length do
t[i] = select(i, ...)
@DasWolke
DasWolke / microservice bots.md
Last active September 17, 2024 05:01
Microservice bots

Microservice Bots

What they are and why you should use them

Introduction

Recently more and more chatbots appear, the overall chatbot market grows and the platform for it grows as well. Today we are taking a close look at what benefits creating a microservice chatbot on Discord - (a communication platform mainly targeted at gamers) would provide.

The concepts and ideas explained in this whitepaper are geared towards bots with a bigger userbase where the limits of a usual bot style appear with a greater effect

Information about Discord itself

(If you are already proficient with the Discord API and the way a normal bot works, you may skip ahead to The Concept)

@alexellis
alexellis / k8s-pi.md
Last active September 24, 2024 14:36
K8s on Raspbian
@josefnpat
josefnpat / Makefile
Last active July 5, 2020 08:19
Love Makefile of Doom
# Copyright 2017 Josef N Patoprsty
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active November 3, 2024 17:14
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@jorio
jorio / Shake.js
Last active November 30, 2016 15:53
custom Shake implementation for Phaser 2 (transpiled from Shake.ts)
"use strict";
var Shake = (function () {
function Shake(game) {
this.game = game;
}
/**
* @param {number} amp amplitude in pixels
* @param {number} duration
* @param {boolean} x shake on X axis