Skip to content

Instantly share code, notes, and snippets.

View vancura's full-sized avatar
🚀
Per aspera ad astra

Václav Vančura vancura

🚀
Per aspera ad astra
View GitHub Profile

Build Blit Ball – a starter game for BLIT386

You are building Blit Ball, an Arkanoid-style brick-breaker, as the flagship starter demo that ships with the create-blit386 scaffolder. Every kid who scaffolds a new BLIT386 project will open this and learn from it. The audience is roughly twelve years old and learning to code. That single fact outranks every other instruction below: when a clever engineering choice and a readable one conflict, pick readable.

Write it in TypeScript now. It will be hand-converted to JavaScript later, so write TS that strips cleanly to JS: classes, interface, plain type aliases, and simple generics only. No enums, no decorators, nothing that leaves scars when the types are removed.

Before you write a line of code

  1. Read the engine docs through the BLIT386 Documentation MCP. Do not guess API signatures – look them up. At minimum read: Getting Started, Core, Game Loop, Rendering, Palette (guide and API), Assets, Input, Overlay, Easing, Camera, and Bitmap Font
@vancura
vancura / AnimatedSprite.cs
Created June 23, 2026 19:09
Animated Sprite for RetroBlit
// ReSharper disable UnusedMember.Global
// ReSharper disable UnusedType.Global
using System;
using System.Collections.Generic;
using JetBrains.Annotations;
namespace Ambilab.Utils {
@vancura
vancura / kortex-loader.svg
Last active November 10, 2025 16:50
Kortex Loader
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vancura
vancura / danger-buttons.md
Last active October 24, 2025 14:44
Danger Button Candidates Analysis

NOTE: This document is deprecated in favor of podman-desktop/podman-desktop#14590


Danger Button Candidates Analysis

This is the analysis of all potential danger button candidates to determine which buttons should be styled as danger (red) buttons.

Only buttons that immediately perform destructive actions should be danger buttons. Buttons that open confirmation dialogs should remain primary/secondary styled, with the confirmation button in the dialog being danger styled instead.

.js-comment:not(.js-minimize-container):not(.timeline-comment-group) {
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
border: 2px black solid;
}
@media (prefers-color-scheme: dark) {
.js-comment:not(.js-minimize-container):not(.timeline-comment-group) {
border-color: white;
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vancura
vancura / git-diff-summarizer.py
Last active November 19, 2023 11:48
This script summarizes staged Git changes, utilizes GPT-4 to generate a Git commit message, and then copies the results to the clipboard.
import subprocess
import clipboard
from openai import OpenAI
client = OpenAI(api_key = "your-openai-key")
# This command returns the staged changes as a patch
git_diff_command = ['git', 'diff', '--cached']
result = subprocess.run(git_diff_command, text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.DEVNULL)
<?xml version="1.0"?>
<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns">
<TypePattern DisplayName="COM interfaces">
<TypePattern.Match>
<And>
<Kind Is="Interface" />
<Or>
<HasAttribute Name="System.Runtime.InteropServices.InterfaceTypeAttribute" />
<HasAttribute Name="System.Runtime.InteropServices.ComImport" />
</Or>

Source Code Typography

Presentation: http://www.slideshare.net/vancura/source-code-typography

Quotes

Dumb quotes (also known as straight quotes) are straight and vertical. Proper typography never uses straight quotes. They are left over from the age of typewriters, and their only modern use is for coding.

@vancura
vancura / dribbble-2x-replacer.js
Created August 14, 2015 14:37
Dribbble @2x replacer: change @1x to @2x.
// ==UserScript==
// @name Dribbble 2x
// @namespace http://vancura.org
// @description Use 2x images
// @homepage http://vancura.org
// @version 0.0.1
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
// @include *://dribbble.com/*
// ==/UserScript==