Skip to content

Instantly share code, notes, and snippets.

View KonnorRogers's full-sized avatar

Konnor Rogers KonnorRogers

View GitHub Profile
@KonnorRogers
KonnorRogers / main.rb
Last active July 6, 2026 21:20
rotating mask
module Main
def tick args
# ./samples/07_advanced_rendering/12_blend_modes_additive_modulo/app/main.rb
# Sample app shows how to use blend modes to create a masking layer
# Special thanks to akzidenz@discord (https://akzidenz.itch.io/) for providing this sample app
#
# blendmode reference:
# 1: alpha blending (default)
# 2: additive blending
# 4: modulo blending
@KonnorRogers
KonnorRogers / index.html
Last active July 6, 2026 02:18
downflow
<div flow-controller="counter">
<button flow-action="click->counter#decrement">-</button>
<span flow-text="context.count">0</span>
<button flow-action="click->counter#increment">+</button>
</div>
<button flow-action="#decrement">-</button>
<span flow-text="context.count">0</span>
<button flow-action="#increment">+</button>
@KonnorRogers
KonnorRogers / button.astro
Created June 18, 2026 14:59
Astro button
---
import Button from "@awesome.me/webawesome/dist/components/button/button.js";
---
<Button>Hi</Button>
<script>
import "@awesome.me/webawesome/dist/components/button/button.js";
</script>
@KonnorRogers
KonnorRogers / glow.rb
Created June 11, 2026 05:02
glow outline blendmode dragonruby
# one-time setup
@glow_dirs ||= 16.times.map do |i|
a = i * Math::PI * 2 / 16
[Math.cos(a), Math.sin(a)]
end
@glow_mask_blend ||= Numeric.compose_blendmode(
BLENDFACTOR_ZERO, BLENDFACTOR_SRC_ALPHA, BLENDOPERATION_ADD,
BLENDFACTOR_ZERO, BLENDFACTOR_SRC_ALPHA, BLENDOPERATION_ADD
)
@glow_hole_punch ||= Numeric.compose_blendmode(
@KonnorRogers
KonnorRogers / main.rb
Created May 30, 2026 22:25
Amir's quiz to remind me i have no idea how delta time works.
def calc_car dt = 1
target_speed = if state.engine == :high
state.high_speed
else
state.low_speed
end
state.speed *= (0.98 * dt) if steering_at_limit?
if auto_break?
@KonnorRogers
KonnorRogers / app.rb
Created April 21, 2026 02:03
simple-conveyor
class Game
attr_gtk # attr_gtk class macro
SPRITES = {
conveyor_belt: {
source_x: 0,
source_w: 16,
source_h: 16,
source_y: 0,
animations: {
@KonnorRogers
KonnorRogers / boolify.js
Created April 1, 2026 20:15
Fix all your environment variable woes
function boolify (str) {
const truthy = [
"y",
"yes",
"1",
"true",
"on"
]
if (str && truthy.includes(str.toLowerCase())) {
@KonnorRogers
KonnorRogers / icon-proposal.md
Last active February 18, 2026 16:45
revamping `<wa-icon>`

Proposal for revamping icons

Current API:

function getIconUrl(name: string, family: string, variant: string) {}

// base "resolver"
{
@KonnorRogers
KonnorRogers / ceph-pad.xml
Created February 17, 2026 19:04
Ceph's notepad XML file
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Dark mode default style for Notepad++.
This file is based on Zenburn them (zenburn.xml)
License: GPL2
-->
<NotepadPlus modelDate="20251214" modelFileLastModifiedDate="20251227">
<LexerStyles>
<LexerType name="actionscript" desc="ActionScript" ext="">
<WordsStyle name="DEFAULT" styleID="11" fgColor="DCDCCC" bgColor="3F3F3F" fontName="" fontStyle="0" fontSize="" />
<!-- https://fluxui.dev/docs/installation sidebar, pulled off of devTools for demonstration purposes. -->
<ui-sidebar class="[grid-area:sidebar] z-1 flex flex-col gap-4 [:where(&amp;)]:w-64 p-4 data-flux-sidebar-collapsed-desktop:w-14 data-flux-sidebar-collapsed-desktop:px-2 data-flux-sidebar-collapsed-desktop:cursor-e-resize rtl:data-flux-sidebar-collapsed-desktop:cursor-w-resize max-lg:data-flux-sidebar-cloak:hidden data-flux-sidebar-on-mobile:data-flux-sidebar-collapsed-mobile:-translate-x-full data-flux-sidebar-on-mobile:data-flux-sidebar-collapsed-mobile:rtl:translate-x-full z-20! data-flux-sidebar-on-mobile:start-0! data-flux-sidebar-on-mobile:fixed! data-flux-sidebar-on-mobile:top-0! data-flux-sidebar-on-mobile:min-h-dvh! data-flux-sidebar-on-mobile:max-h-dvh! max-h-dvh overflow-y-auto overscroll-contain max-lg:bg-white dark:bg-zinc-900 lg:w-54 lg:mr-16 max-lg:p-8 lg:pl-0 max-lg:w-64 py-12 gap-7 pr-20 max-lg:border-r border-transparent dark:border-white/10 print:hidden text-sm transition-transform" x-i