Skip to content

Instantly share code, notes, and snippets.

@drhayes
drhayes / .editorconfig
Created Jul 16, 2021
My personal root .editorconfig.
View .editorconfig
root = true
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
[*.{js,py}]
charset = utf-8
@drhayes
drhayes / squiggly-line.svg
Created Jul 15, 2021
A neato, animated squiggly line that could repeat horizontally.
View squiggly-line.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@drhayes
drhayes / markdown.json
Created Jun 14, 2021
My current custom markdown snippets for Visual Studio Code.
View markdown.json
{
"Manual excerpt split": {
"prefix": "more",
"body": [
"<!--more-->"
],
"description": "A properly formatted content summary split which I can never remember."
},
"New note template": {
"prefix": "newnote",
@drhayes
drhayes / lua.json
Created Jun 14, 2021
My current custom lua snippets for Visual Studio Code.
View lua.json
{
// Place your snippets for lua here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@drhayes
drhayes / javascript.json
Created Jun 14, 2021
My current custom JavaScript snippets for Visual Studio Code.
View javascript.json
{
"Print to console": {
"prefix": "clog",
"body": [
"console.log($1);$0"
],
"description": "Console log"
},
"CommonJS require": {
"prefix": "creq",
@drhayes
drhayes / work-nerds-code-of-conduct.md
Last active May 26, 2021
The Code of Conduct for the Discord server Work Nerds
View work-nerds-code-of-conduct.md

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

View createReleaseNotes.js
const { exec } = require('child_process');
const verbData = {
chore: {
label: 'Chores',
renderOrder: 4,
},
feat: {
label: 'New Features',
renderOrder: 0,
@drhayes
drhayes / button.lua
Created Apr 3, 2020
The basic button control from my GUI lib in Gemini Rising
View button.lua
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 Feb 18, 2020
Gemini Rising release script as of 2020-02-18
View release.sh
#!/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"
View xassert.lua
# 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)