Skip to content

Instantly share code, notes, and snippets.

@denilsonsa
denilsonsa / main.py
Created August 10, 2025 07:01
Experimenting with asyncio
#!/usr/bin/env python3
# This is some experimental code I wrote while trying to learn more about asyncio in Python 3.
# I wrote it many years ago, I remember nothing about it.
# I'm uploading it to a Gist so in the future I will be able to refer back to it.
import asyncio
from aiohttp import web
@denilsonsa
denilsonsa / README.md
Last active July 30, 2025 07:35
A slice of (retro) PC gaming

A bunch of classic and memorable (old) PC games. Some are very well known, other are more niche hidden games. They are all worth revisiting.

Here's the list, in no particular order. Mostly because this is a dump of a brainstorm of a list of PC games. I spend hours thinking about them, so I'd rather take note.

@denilsonsa
denilsonsa / ssprogressbar.mjs
Last active June 24, 2025 21:53
Stupid Simple Progress Bar (printing nice progress bars at the terminal)
#!/usr/bin/env node
// Stupid simple progress bar.
class StupidSimpleProgressBar {
constructor(blocks, {prefix='', suffix='', totalWidth=78}) {
this.blocks = blocks;
this.prefixes = prefix.split('\n');
this.suffixes = suffix.split('\n');
this.totalWidth = totalWidth;
@denilsonsa
denilsonsa / lit-transition.js
Last active April 2, 2025 05:15
Mixing Lit v1 and Lit v2/v3 html and css templates
// lit-transition.js
// Provides some functions/objects that work on both Lit v1 and Lit v2/v3.
// This code is based on this proof-of-concept: https://codepen.io/denilsonsa/pen/dPyWZbY
// How to use this code? Use this:
// import { multicss as css, multihtml as html, multinothing as nothing } from './lit-transition.js';
// Instead of Lit's own css, html and nothing functions/objects.
////////////////////////////////////////////////////////////
@denilsonsa
denilsonsa / mobile_games.md
Last active June 10, 2025 07:34
Recommendations of mobile apps and mobile games
@denilsonsa
denilsonsa / AveryLabels.ipynb
Last active August 16, 2024 16:40
Avery labels template parser
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@denilsonsa
denilsonsa / README.md
Last active July 2, 2024 15:43
Python Mandelbrot fractal

Python Mandelbrot fractal

Trivial implementation of the Mandelbrot fractal written in pure Python. It outputs to the terminal using 24-bit ANSI escape codes, which is widely supported by many terminals.

No optimization was done to the code. It's supposed to be simple and straightforward.

There is a one-to-one mapping between each calculated point from the fractal and one output character. This results in a low-resolution image made of characters (instead of pixels),

@denilsonsa
denilsonsa / README.md
Last active June 18, 2024 21:30
Steam Community modals as links

Steam Community modals as links

Converts pseudo-links from Steam Community into real anchor tags. Advantages:

  • No JavaScript needed for opening Steam Community items. They are now plain links.
  • We can open them as a full page, instead of being constrained to the clunky modal dialog.
  • We can open them as a new tabs or as a new windows.
  • We can right-click to copy the link to each item.
  • We can click-and-drag the link.
  • We can open many items as background tabs (by middle-clicking on them) and let them load in the background, instead of forcing us to wait for them to load.
@denilsonsa
denilsonsa / README.md
Last active May 1, 2024 20:08
Steam Input controller layouts

Steam Input controller layouts

This Gist tries to collect the Steam Input controller layouts that I have created. (And possibly others I might have found online.)

Unfortunately, sharing layouts is painful due to lack of features on Valve's side. Thus, I'm creating this humble text file over here.

See also

Want to learn more about Steam Input?

@denilsonsa
denilsonsa / Guide.md
Last active June 25, 2024 22:30
How to add Windows-only non-Steam games to Steam Deck

How to add Windows-only non-Steam games to Steam Deck

This guide explains how to add a Windows-only game (or application) to Steam Deck. It also works for Steam running on Linux on any hardware (your laptop, your desktop, etc.). By following these instructions you can add any freeware and fan-game to your system. Of course, just be careful and don't download anything suspicious.

This guide was originally written as a comment to a YouTube video. However, YouTube comments are trash and are randomly silently dropped, so I'm rewriting it here. It's also easier to point people towards this guide.

Prerequisites

  • You know how to use the desktop mode.
  • You understand the concept of files and folders; and you know how to uncompress a ZIP file (or whatever format you have downloaded).