Skip to content

Instantly share code, notes, and snippets.

@danuker
danuker / youtube_summarizer.py
Last active September 2, 2025 15:20
YouTube Summarizer
#!/usr/bin/env python3
# The MIT License (MIT)
# Copyright © 2025 Dan Gheorghe Haiduc
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
@travislima
travislima / my-pmpro-valid-shipping-zip-codes.php
Last active September 2, 2025 15:17 — forked from andrewlimaza/my-pmpro-valid-shipping-zip-codes.php
Only allow shipping to specific Zip Codes for Paid Memberships Pro Shipping.
<?php
/**
* This will only allow users to checkout with specific zip codes for the Shipping Add On for Paid Memberships Pro.
* You will need to use this code recipe together with the PMPro Shipping Address Add On - https://www.paidmembershipspro.com/add-ons/shipping-address-membership-checkout/
* Add the code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_valid_zip_codes( $pmpro_continue_registration ) {

Estimativa de Consumo AWS ElastiCache com ECSTATS2

Este tutorial mostra como rodar o script ecstats2, que acessa métricas do AWS CloudWatch para estimar uso de ElastiCache Redis, sem conectar diretamente ao Redis.


🔐 Segurança

O script não interage com o Redis. Ele só acessa o CloudWatch. Não há risco de impacto na performance dos bancos de dados.

@fallenartist
fallenartist / Display_ST7701.cpp
Created January 28, 2025 11:51
Waveshare ESP32-S3 Touch LCD 2.1 Example
#include "Display_ST7701.h"
spi_device_handle_t SPI_handle = NULL;
esp_lcd_panel_handle_t panel_handle = NULL;
void ST7701_WriteCommand(uint8_t cmd)
{
spi_transaction_t spi_tran = {
.cmd = 0,
.addr = cmd,
.length = 0,

What is this?

This is where I'll document my research for controlling the SoundCore Liberty Air 2 Pro TWS earbuds without using the manufacturer's mobile app.

First task

The first thing I'll do, and likely the easiest, is figure out how to switch between ANC modes. These earbuds come with Active Noise Cancellation and let you switch between 3 modes: Noise Cancellation, Transparency, and Normal (no ANC applied). The two ANC modes also come with their own submodes.

  • Noise Cancellation
    • Transport
    • Indoor
    • Outdoor
  • Custom (lets you spin a slider to adjust some opaque parameter of the ANC algorithm, ignored for now)

[fit]Port Bluedroid to RTOS






by スカイストリーム せきね

@xero
xero / irc.md
Last active September 2, 2025 15:03
irc cheat sheet
@Quasimondo
Quasimondo / gist:ad6e3bc3e0e29db42ee9f3bfcf057853
Last active September 2, 2025 15:01
Stream WAV Files as Bluetooth Mic Input from Raspberry Pi Zero W

Stream WAV Files as Bluetooth Mic Input from Raspberry Pi Zero W

Author: Mario Klingemann

Description

This guide configures a Raspberry Pi Zero W to stream WAV files (8kHz, mono PCM) to a phone via Bluetooth Hands-Free Profile (HFP), simulating a microphone for calls. Tested on Raspbian Bullseye with a Pixel 8 Pro and Pixel 6 Pro, it should work with similar setups.

Note: due to restrictions of Android it seems that headset microphones are not allowed to use certain features like voice assistant or voice typing on the keyboard. This seems to be an ongoing nuisance and I have not found a solution for it.

Note: this might not work on a Raspberry Zero 2 W, since it is using a different bluetooth chip which seems to have certain quirks.

@untainsYD
untainsYD / switch_audio_profile.sh
Created July 8, 2025 14:55
Sony MX5/MX6 audio profile switcher
# Sony MX5 profile switcher with proper profile names
# Features:
# - Automatic notifications when switching profiles
# - Toggle between LDAC and mSBC with visual feedback
# - Shows profile transition (from → to) in notifications
DEVICE_MAC="AC:80:0A:30:3A:DD"
get_card_name() {
pactl list cards short | grep bluez_card.${DEVICE_MAC//:/_} | cut -f2
@andersevenrud
andersevenrud / alacritty-tmux-vim_truecolor.md
Last active September 2, 2025 15:00
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh