Skip to content

Instantly share code, notes, and snippets.

View rochacbruno's full-sized avatar
🛠️
Working on Galaxy_ng and Dynaconf

Bruno Rocha rochacbruno

🛠️
Working on Galaxy_ng and Dynaconf
View GitHub Profile
@rochacbruno
rochacbruno / debug_ovi_env.md
Created February 25, 2024 13:25
Debug in OCI ENV

Debug in oci-env

Add the breakpoint to the task, then stop workers and start a worker manually.

$ s6-svc -d /var/run/service/pulpcore-worker\@1/
$ pulpcore-worker
@rochacbruno
rochacbruno / A.md
Created February 9, 2024 14:16
Delete youtube watch later

Delete whatch later videos from youtube

  • OPen youtube, change language to English
  • Go to your watch later playlist
  • OPen the inspect -> console
  • Paste the script and execute it
{
"workbench.startupEditor": "newUntitledFile",
"editor.fontSize": 14,
"editor.lineHeight": 1.8,
"javascript.suggest.autoImports": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"editor.rulers": [80, 120],
"extensions.ignoreRecommendations": true,
"typescript.tsserver.log": "off",
"files.associations": {
@rochacbruno
rochacbruno / helix_config.toml
Created September 20, 2023 10:49
Helix file picker
### requires the script lf-pick on path
### Requires lf installed https://github.com/gokcehan/lf
### lf has the keybindings: <space> select file, lowercase `l` accept selection
### or use arrow right to open the file
### This allows selecting multiple files with space and then hit `l` to open
# touch ~/.local/bin/lf-pick
# chmod +x ~/.local/bin/lf-pick
# function lfp(){
# local TEMP=$(mktemp)
# lf -selection-path=$TEMP
@rochacbruno
rochacbruno / scores.py
Last active September 13, 2023 16:48
galaxy_scores
"""
Dumps each collection and repository scores to a local scores/ folder
"""
import json
import sys
from pathlib import Path
from statistics import mean
from typing import Dict, Optional, Union
@rochacbruno
rochacbruno / languages.toml
Created September 5, 2023 15:11
Rust helix inlay hints config
[[language]]
name = "rust"
auto-format = false
[language-server.rust-analyzer]
command = "rust-analyzer"
[language-server.rust-analyzer.config]
inlayHints.bindingModeHints.enable = false
inlayHints.closingBraceHints.minLines = 10
@rochacbruno
rochacbruno / config.toml
Created September 5, 2023 07:40
Helix config for writing texts a.k.a Zen Mode
theme = "manutheme2" #catppuccin-frappe, but with edited statusbar bg color
[editor]
#line-number = "relative"
#cursorline = true
@rochacbruno
rochacbruno / gist:b02c459d314db31ff77a761732c05aa2
Created September 4, 2023 16:54 — forked from jatcwang/gist:ae3b7019f219b8cdc6798329108c9aee
List of all setxkbmap configuration options (including models/layout/etc)
! model
pc101 Generic 101-key PC
pc102 Generic 102-key (Intl) PC
pc104 Generic 104-key PC
pc105 Generic 105-key (Intl) PC
dell101 Dell 101-key PC
latitude Dell Latitude series laptop
dellm65 Dell Precision M65
everex Everex STEPnote
flexpro Keytronic FlexPro
"""E o pintinho piu."""
class Bicho:
def __init__(self, nome, som):
self.nome = nome
self.som = som
self.sexo = nome[-1] == "a" and "a" or "o"
def sound(self, times=1):
@rochacbruno
rochacbruno / fastapi_session.py
Last active March 9, 2024 16:57
Session based cookie auth fastapi
from fastapi import Request, Depends, HTTPException, Response
from fastapi.responses import RedirectResponse
# This must be randomly generated
RANDON_SESSION_ID = "iskksioskassyidd"
# This must be a lookup on user database
USER_CORRECT = ("admin", "admin")
# This must be Redis, Memcached, SQLite, KV, etc...