Skip to content

Instantly share code, notes, and snippets.

lucianoratamero /
Last active December 20, 2022 13:21
How to iterate through string literals in TypeScript

How to iterate through string literals in TypeScript

// In edge cases, it would be useful to iterate through a string literal,
// so you can do something based on each value.

// Let's say you have a literal of UserRoles
lucianoratamero /
Last active July 20, 2024 13:27
Using Vite with Django, the simple way

Using Vite with Django, the simple way


I'm surely not maintaining this as well as I could. There are also other possible, better integrated solutions, like django-vite, so keep in mind this was supposed to be more of a note to myself than anything :]

This gist has most of the things I've used to develop the frontend using vite inside a monolithic django app.

Here's a boilerplate that uses this approach:

A couple of things to note:

lucianoratamero /
Last active September 18, 2023 21:04
breact: a naive implementation of a react-like component API in brython
from browser import html
from breact import render_to_DOM, Component
from Counter import Counter
class App(Component):
def render(self):
return html.DIV([
lucianoratamero /
Last active June 5, 2024 11:03
Export Gnome settings and extensions python script

This script makes it easier to copy Gnome settings and extensions from one pc to the other. It supports python>=3.5.

To use it, download it, then run python3 --export-settings to create a tar.gz file with all the settings.

Then, on your new system, copy the script and the gzip to your user's home directory and run python3 --import-settings.

For now, the script migrates:

lucianoratamero /
Last active April 2, 2023 15:37
neovim configs - put inside ~/.config/nvim/
lucianoratamero / cloudSettings
Last active December 9, 2020 02:29
Visual Studio Code Settings Sync Gist
lucianoratamero / firefox-patched.desktop
Last active June 8, 2018 17:15
Fixes Firefox on Ubuntu 18.04 - Freezing when clicking in or out a form field (mostly password fields) - add it to `~/.local/share/applications/`
[Desktop Entry]
Name=Patched - Firefox Web Browser
Name[ar]=Patched - متصفح الويب فَيَرفُكْس
Name[ast]=Patched - Restolador web Firefox
Name[bn]=Patched - ফায়ারফক্স ওয়েব ব্রাউজার
Name[ca]=Patched - Navegador web Firefox
Name[cs]=Patched - Firefox Webový prohlížeč
Name[da]=Patched - Firefox - internetbrowser
Name[el]=Patched - Περιηγητής Firefox
lucianoratamero / config.cson
Last active May 10, 2018 14:38
atom config - imported via the 'Config import export plugin'
legacyMode: true
lastUpdateTimestamp: 1518799191736
darwin: ""
freebsd: ""
linux: "~/AtomBackups"