Skip to content

Instantly share code, notes, and snippets.

View shanecelis's full-sized avatar

Shane Celis shanecelis

View GitHub Profile
@shanecelis
shanecelis / mail-app
Created December 11, 2025 08:29
Simulate regular mail binary on macOS using Mail.app because I don't have the patience to configure postfix once a blue moon.
#!/bin/bash
# Original code Copyright (c) 2024 Shane Celis[1]
# Licensed under the MIT License[2]
#
# [1]: https://mastodon.gamedev.place/@shanecelis
# [2]: https://opensource.org/licenses/MIT
# mail-app
#
@shanecelis
shanecelis / hello-ink.lua
Last active December 10, 2025 08:51
Run an Ink story from Nano-9, a Pico-8 compatibility layer for Bevy.
story = ink_load("hello.ink.json")
-- Are we waiting for a choice?
waiting = false
-- Here are the y positions of the choice?
choices_y = {}
-- Here is our current choice.
choice_index = 1
function _update()
if not waiting then
@shanecelis
shanecelis / markcmd
Created October 8, 2025 17:52
Create a markdown block from command output.
#!/bin/bash
# markcmd
#
# Create a markdown block from command output.
#
# $ markcmd echo hi
# ```sh
# $ echo hi
# hi
# ```
@shanecelis
shanecelis / label-video
Created June 5, 2025 07:54
Shell script to label a video using ffmpeg.
#!/bin/bash
# label-video
function usage() {
echo "usage: label-video [-tlrb] [-c COLOR] [-s SIZE] [-f FONT.ttf] MESSAGE INPUT.mp4 OUTPUT.mp4";
echo " [-tlrb] top, left, right, bottom";
echo " -c set text color"
echo " -s set text size"
echo "Adds a label to a video file using ffmpeg."
}
@shanecelis
shanecelis / record-window
Created December 31, 2024 05:02
Record a window excluding title bar of a macOS application
#!/bin/bash
# record-window
function usage() {
echo "usage: record-window [-hf] [-n window-number] <application> <capture.mov>" >&2;
echo " -h help; show usage (this)" >&2;
echo " -f force recording (remove previous output file if present)" >&2;
echo "Record a window excluding title bar of an application (case-sensitive)" >&2;
}
# b-graph.dot
#
# $ dot -Tpng b-graph.dot -o b-graph.png
digraph G {
Foo0 [shape=record, label="{Foo | Children | Observers}"];
Bar0 [shape=record, label="{Bar | OhHiMark}"];
Bar1 [shape=record, label="{Bar | Children}"];
Baz0 [shape=record, label="{Baz}"];
Observer0 [shape=record, label="{system}"];
Foo0 -> Bar0[label="child"];
@shanecelis
shanecelis / click.rs
Created July 20, 2024 10:22
Click event for bevy
/* Original code Copyright (c) 2024 Shane Celis[1]
Licensed under the MIT License[2] or Apache License v2.0[3]
[1]: https://mastodon.gamedev.place/@shanecelis
[2]: https://opensource.org/licenses/MIT
[3]: https://www.apache.org/licenses/LICENSE-2.0
*/
//! Click event for Bevy.
//!
@shanecelis
shanecelis / try_collect.rs
Created March 23, 2024 04:56
Try to collect from an iterator that may fail.
use std::fmt::Debug;
use std::iter::FromIterator;
/// Try to collect from an iterator that may fail.
///
/// # Motivation
///
/// I really wanted to be able to turn a `Iterator<Item = u8>` into a String
/// more easily.
///
#!/bin/bash -e
# unity-log
usage() {
echo "Usage: unity-log [-te] <Company> <Application>" >&2;
echo " -t tail log" >&2;
echo " -e editor log" >&2;
exit 2;
}
cmd=echo;
@shanecelis
shanecelis / befungoban.js
Created December 21, 2022 10:10
A Befunge + Sokoban mashup for sprig
/*
@title: Befungoban
@author: Shane Celis @shanecelis
https://esolangs.org/wiki/Befunge
http://qiao.github.io/javascript-playground/visual-befunge93-interpreter/
*/
const player = "p";
const selection = "b";