Skip to content

Instantly share code, notes, and snippets.

View luzfcb's full-sized avatar

Fábio C. Barrionuevo da Luz luzfcb

View GitHub Profile
@allisson
allisson / ubuntu-2204-remove-snap.md
Last active June 24, 2024 16:13
Ubuntu 22.04 remove snap

Remove snaps

sudo snap remove --purge firefox
sudo snap remove --purge snap-store
sudo snap remove --purge snapd-desktop-integration
sudo snap remove --purge gtk-common-themes
sudo snap remove --purge gnome-3-38-2004
sudo snap remove --purge core20
sudo snap remove --purge bare
sudo snap remove --purge snapd
@insertish
insertish / React Native.md
Last active July 18, 2024 09:31
Configure React Native with Typescript, Vite.js for react-native-web and Storybook.
@tmo1
tmo1 / nextcloud-caddy-docker.md
Last active July 16, 2024 15:53
Nextcloud behind Caddy as a reverse proxy, using Docker

Introduction

This is a guide to deploying Nextcloud behind a Caddy reverse proxy, both running in Docker containers (an official Nextcloud one and a caddy-docker-proxy one), with the goal of implementing as much as possible via docker-compose files. This is much more difficult than it should be, for a variety of reasons:

  • As with Docker versions of software in general, documentation of the software does not always apply to the Docker versions, and the Docker documentation does not always include the Docker equivalent ways of doing things.

  • Docker images do not always expose the desired configuration knobs of the underlying software.

  • Nextcloud requires special configuration to run correctly behind a reverse proxy (and again, some of the instructions for this configuration requires modification for

@bmispelon
bmispelon / find_templates.py
Created October 20, 2021 14:55
Exhaustively list all available templates in a Django project
from pathlib import Path
from django import template
def gen_all_templates():
"""
Generate the list of all available templates as tuples of 3 values:
- the template engine
@jsbueno
jsbueno / rate_limiter.py
Last active August 19, 2021 21:32
Rate Limiter for async APIs. Juste create one guard for different API in your process. Not multiprocess safe!
def create_rate_limit_guard(rate_limit=1200, safety_margin=0.9):
"""Rate limit is given in maximum requests per minute.
"""
# TBD: it would easy to have code to throttle by maximum active requests
# instead of total requests per minute.
# I will just let the accounting of concurrent_requests in place, though
class Guard:
request_interval = (60 / rate_limit) * safety_margin
@luzfcb
luzfcb / template_LGPD.md
Last active July 22, 2024 03:30
Template LGPD - Template para solicitar exclusão de dados conforme a LGPD - Lei Geral de Proteção de Dados do brasil. LEI Nº 13.709, DE 14 DE AGOSTO DE 2018. Disclaimer: Não sou advogado e não me responsabilizo por qualquer coisa decorrente do uso desde conteudo. Use por sua conta e risco.

Olá <NOME_EMPRESA>.

Vocês estão me enviando <email, ligação, SMS, via plataforma Whatsapp, via plataforma Telegram> comerciais não-solicitados, portanto SPAM.

No dia vocês enviaram ao meu uma mensagem comércial, com o seguinte texto:

<MENSAGEM>
@lucianoratamero
lucianoratamero / README.md
Last active July 20, 2024 13:27
Using Vite with Django, the simple way

Using Vite with Django, the simple way

Warning

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: https://github.com/labcodes/django-react-boilerplate

A couple of things to note:

@ramsrib
ramsrib / fields.py
Last active May 2, 2023 22:32 — forked from ambivalentno/svgimagefield.py
A form field to handle validation of image + svg in Django 3
import sys
import xml.etree.cElementTree as et
from io import BytesIO
from django.core.exceptions import ValidationError
from django.core.validators import (
FileExtensionValidator,
get_available_image_extensions,
)
from django.forms import ImageField as DjangoImageField
@Foadsf
Foadsf / README.md
Last active March 22, 2024 05:57
Scripting LibreOffice with Python

This tutorial was originally written by Jannie Theunissen on onesheep.org. However, the website has been down for a while and this a clone from the web.archive.org backup. Also, the parts regarding the macOS are updated according to this post. You may find OneSheep here on Twitter and Jannie Theunissen here on StackOverflow. If you have any comments on this Gist please poke me here on Twitter, otherwise, I might miss your comments.

Scripting LibreOffice with Python

We were recently asked to automate some editing tasks for the Spotlight English editors w

@luzfcb
luzfcb / CalibreServerOnLinux.md
Created February 23, 2020 22:54 — forked from plembo/CalibreServerOnLinux.md
Calibre Server on Linux

Calibre Server on Linux

Introduction

Calibre is a powerful cross-platform, open source, ebook manager and editing platform. Its calibre-server component can be used to publish an e-book library on a local network. While you can launch calibre-server as a desktop application, it can also be run as a daemon on a headless Linux server.

This tutorial on setting up calibre-server using Ubuntu 14.04 is very good, but dated.