Skip to content

Instantly share code, notes, and snippets.

View rochacbruno's full-sized avatar
☺️

Bruno Cesar Rocha rochacbruno

☺️
View GitHub Profile
name description
browser-fetch
Fetch authenticated web content using browser session (SSO, internal sites)

browser-fetch Skill

Fetch web content from authenticated/internal sites using a real browser with persistent login sessions.

Repository: https://github.com/benthomasson/browser-fetch

@benthomasson
benthomasson / SKILL.md
Last active February 13, 2026 19:27
curl skill
name description
curl
Fetch web content using curl (faster alternative to WebFetch)

curl Skill

Quick reference for fetching web content with curl instead of WebFetch tool.

When to Use This Skill

Project: My Awesome TypeScript Library

General Instructions:

  • When generating new TypeScript code, please follow the existing coding style.
  • Ensure all new functions and classes have JSDoc comments.
  • Prefer functional programming paradigms where appropriate.
  • All code should be compatible with TypeScript 5.0 and Node.js 18+.

Coding Style:

@kepler-5
kepler-5 / comp_multi.rs
Last active February 9, 2026 09:48
Python comprehension proc macro that handles multiple nested for-if-clauses, flattening nested structure
// This is free and unencumbered software released into the public domain.
// Anyone is free to copy, modify, publish, use, compile, sell, or
// distribute this software, either in source code form or as a compiled
// binary, for any purpose, commercial or non-commercial, and by any
// means.
// In jurisdictions that recognize copyright laws, the author or authors
// of this software dedicate any and all copyright interest in the
// software to the public domain. We make this dedication for the benefit
@tsmethurst
tsmethurst / 0.17.0_migrations.sql
Created October 16, 2024 11:21
Summary of migrations from 0.16.0 to 0.17.0 (approximate)
CREATE TABLE IF NOT EXISTS "conversations" ("id" CHAR(26) NOT NULL, "created_at" timestamptz NOT NULL DEFAULT current_timestamp, "updated_at" timestamptz NOT NULL DEFAULT current_timestamp, "account_id" CHAR(26) NOT NULL, "other_account_ids" VARCHAR, "other_accounts_key" VARCHAR NOT NULL, "thread_id" CHAR(26) NOT NULL, "last_status_id" CHAR(26) NOT NULL, "read" BOOLEAN DEFAULT false, PRIMARY KEY ("id"), UNIQUE ("id"), CONSTRAINT "conversations_account_id_last_status_id_uniq" UNIQUE ("account_id", "last_status_id"), CONSTRAINT "conversations_thread_id_account_id_other_accounts_key_uniq" UNIQUE ("account_id", "other_accounts_key", "thread_id"));
CREATE TABLE IF NOT EXISTS "conversation_to_statuses" ("conversation_id" CHAR(26) NOT NULL, "status_id" CHAR(26) NOT NULL, CONSTRAINT "conversation_to_statuses_conversation_id_status_id_uniq" UNIQUE ("conversation_id", "status_id"));
CREATE INDEX IF NOT EXISTS "conversations_account_id_idx" ON "conversations" ("account_id");
CREATE INDEX IF NOT EXISTS "conversations_las
@pedro-psb
pedro-psb / dynaconf_typing_experiment.py
Created May 15, 2024 23:31
Small experiment with adding Schema typing workaround for Dynaconf. https://github.com/dynaconf/dynaconf/issues/1082
import typing as t
from dataclasses import dataclass, is_dataclass
# not strictly necessary, but makes sense
T = t.TypeVar("T") # https://mypy.readthedocs.io/en/stable/generics.html
class ValidationError(ValueError):
...
@egdoc
egdoc / gist:753d3c934f5892a32a29de916fbce8b1
Created May 3, 2024 20:38
Set user avatar using dbus
dbus-send --system --print-reply \
--dest=org.freedesktop.Accounts \
/org/freedesktop/Accounts/User1000 \
org.freedesktop.Accounts.User.SetIconFile string:/path/to/image.jpg
@andrelop
andrelop / gist:941be7f182c11a4a3204f6a9031258a2
Last active May 1, 2024 21:42
Example backup script for Mastodon, WriteFreely and Miniflux
#!/bin/bash
TODAY=$(date +%Y%m%d)
YESTERDAY=$(date --date '1 day ago' +%Y%m%d)
# Backup Mastodon database
MASTODON_DB_CONTAINER=$(docker ps | grep mastodon_postgresql | awk '{print $1}')
docker exec -it ${MASTODON_DB_CONTAINER} bash -c 'rm -rf /var/lib/postgresql/data/'${YESTERDAY}' || true ; mkdir /var/lib/postgresql/data/'${TODAY}' || true'
docker exec -it ${MASTODON_DB_CONTAINER} bash -c 'pg_dumpall -c -U mastodon > /var/lib/postgresql/data/'${TODAY}'/mastodon-dump.sql'
@lalizita
lalizita / ffmpeg_video_examples.sh
Created October 24, 2023 22:38
ffmpeg scripts for video processing
# Cut/Trim video
ffmpeg -ss 5 -i input.mp4 -to 10 output.mp4
# Video to gif
ffmpeg -ss 61.0 -t 2.5 -i <input> -filter_complex "[0:v] fps=12,scale=w=480:h=-1,split [a][b];[a] palettegen=stats_mode=single [p];[b][p] paletteuse=new=1" output.gif
# thumbnail
ffmpeg -i mov_bbb.mp4 -ss 00:00:03 -r 1 -s 1280x720 -f image2 thumb_mov.jpeg
#text in video
@samuelcolvin
samuelcolvin / aicli.py
Last active March 2, 2024 16:04
OpenAI powered AI CLI in just a few lines of code - moved to https://github.com/samuelcolvin/aicli
#!/usr/bin/env python3
import os
from datetime import datetime, timezone
from pathlib import Path
from prompt_toolkit import PromptSession
from prompt_toolkit.history import FileHistory
import openai
from rich.console import Console
from rich.markdown import Markdown