Skip to content

Instantly share code, notes, and snippets.

@denilsonsa
denilsonsa / README.md
Created January 16, 2026 19:24
download_twitpic.py

This is a small Python 2 script written in 2011 to download a bunch of images from the (defunct) website twitpic.com.

Back then, Twitter was really a microblogging platform that only allowed short text messages and nothing else. TwitPic was a third-party website to host user-submitted images with short URLs, and those URLs could be embedded into normal tweets.

Around that time, I was playing a lot of Super Meat Boy, and for some reason I wanted to download and view all the images posted in that Twitter/TwitPic account. So I wrote this script. I ran it like this:

./download_twitpic.py  http://twitpic.com/photos/SuperMeatBoy?page={1..9}
@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 September 24, 2025 13:52
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?