Skip to content

Instantly share code, notes, and snippets.

View drhayes's full-sized avatar
🐱

David Hayes drhayes

🐱
View GitHub Profile
@drhayes
drhayes / work-nerds-code-of-conduct.md
Last active May 26, 2021 22:03
The Code of Conduct for the Discord server Work Nerds

Welcome to the Work Nerds community!

In order to foster a welcoming and inclusive environment for everyone, we ask all members to read and agree to our Code of Conduct when joining. This Code of Conduct is a living document and will be updated from time to time as necessary. The current version can always be found at https://drhay.es/work-nerds-coc. All changes will be announced in the #announcements channel of our Discord server as they are made. Agreeing to the Code of Conduct implies that you will monitor these changes and revoke your agreement if and when you no longer agree.

Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible

const { exec } = require('child_process');
const verbData = {
chore: {
label: 'Chores',
renderOrder: 4,
},
feat: {
label: 'New Features',
renderOrder: 0,
@drhayes
drhayes / button.lua
Created April 3, 2020 01:30
The basic button control from my GUI lib in Gemini Rising
local Button = Control:extend()
Button:implement(EventEmitter)
function Button:new(text, x, y, w, h)
self.text = text
w = w or (ui.font:getWidth(text) + 20)
h = h or 20
Button.super.new(self, x, y, w or 40, h)
self.layout = fillLayout(0)
self.fill = self:add(Fill())
@drhayes
drhayes / release.sh
Created February 18, 2020 19:47
Gemini Rising release script as of 2020-02-18
#!/usr/bin/env bash
set -e
set -x
MY_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
MY_DIR=$(realpath "${MY_DIR}"/..)
GITHUB_WORKSPACE=${GITHUB_WORKSPACE:-$MY_DIR}
LOVEVERSION="11.2"
# From http://lua.space/general/assert-usage-caveat
function xassert(a, ...)
if a then return a, ... end
local f = ...
if type(f) == "function" then
local args = {...}
table.remove(args, 1)
error(f(unpack(args)), 2)
else
error(f or "assertion failed!", 2)
@drhayes
drhayes / query.graphql
Created January 13, 2020 16:51
GraphQL query for v4 GitHub API to find every user in an organization
query {
organization(login: "org-goes-here") {
samlIdentityProvider {
ssoUrl
externalIdentities(first: 100) {
edges {
node {
guid
samlIdentity {
nameId
@drhayes
drhayes / eventEmitter.lua
Last active September 9, 2019 20:31
`EventEmitter` in Lua (primarily) for my OOP-y, retained-mode, gamepad-friendly UI library.
local Object = require 'lib.classic'
local function push (t, ...)
local pushed = select('#', ...)
for i = 1, pushed do
t[t.n + i] = select(i, ...)
end
return t.n + pushed
@drhayes
drhayes / rexpaint.lua
Last active March 5, 2024 02:13
A lightweight REXPaint .xp file reader for LOVE2D.
--
-- A lightweight REXPaint .xp reader for LOVE2D.
-- By Vriska Serket / @arachonteur
-- Adapted by drhayes to not use self, make constants uppercase,
-- and updated to work with love 11.2.
-- From https://gist.github.com/vriska-serket/334bfcfa7dfe7265ddbe089e4a51e522
--
-- Output table looks like this.
--[[
{
@drhayes
drhayes / README.md
Created April 1, 2019 15:54
SCRIPT-8
@drhayes
drhayes / brain.lua
Created March 22, 2019 17:13
An old, busted version of coroutine-based AI
local Brain = {}
local currentTime = 0
local timeWaits = {}
local animWaits = {}
local yields = {}
local function yield()
local co = coroutine.running()
yields[co] = true
return coroutine.yield(co)