Skip to content

Instantly share code, notes, and snippets.

View PedroManse's full-sized avatar
💭
Still trying to make an HTML parser with regex

Manse PedroManse

💭
Still trying to make an HTML parser with regex
View GitHub Profile
@PedroManse
PedroManse / oracle.sql
Created September 24, 2025 13:44
Search table by column name
SELECT DISTINCT(table_name), column_name
FROM DBA_TAB_COLUMNS
WHERE column_name LIKE '%${name}%';
@PedroManse
PedroManse / defer.c
Created August 19, 2025 14:17
Defer an action
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#define defer(DefId) ;\
auto void def_##DefId(void*); \
void *var_##DefId __attribute__( (__cleanup__(def_##DefId)) ) = NULL; \
void def_##DefId (void *_)
@PedroManse
PedroManse / change-sink.sh
Created August 14, 2025 17:56
Change default sink (and notify user with hyprland)
#! /usr/bin/env bash
if [ "$1" = "-1" ] ; then
dif=-1
else
dif=1
fi
sinks_str=$(pactl list sinks | grep "Name:" | cut -d' ' -f2 )
curent_sink=$(pactl get-default-sink)
@PedroManse
PedroManse / record.sh
Created August 14, 2025 13:38
Graver um vídeo com wf-recorder e selecionar sink manualmente ou automaticamente
#! /usr/bin/env bash
if [ -z "$AUTO" ]; then
sink=$(
pactl list sources |
filte and[ +Name +output ] |
wofi -d |
cut -f2 -d' '
)
else
@PedroManse
PedroManse / AntD.ts
Created August 12, 2025 14:06
AntD labeled Table
// Method-less
export type LabeledTableData = {
id: number | string
v1: { label: string, value: number },
v2: { label: string, value: string },
v3: { label: string, value: number },
v4: { label: string, value: number },
v5: { label: string, value: string },
v6: { label: string, value: number },
v7: { label: string, value: number },
@PedroManse
PedroManse / pdf.ts
Last active August 11, 2025 14:30
Nest service for pdf generation with long-lived browser
import * as p from 'puppeteer';
import { Injectable } from '@nestjs/common';
@Injectable()
export class PdfGenerator {
private browser: Promise<p.Browser>;
constructor () {
this.browser = p.launch();
}
import re
# Raw input values (shortened for demonstration; replace with full list in production)
raw_numbers = """
010-000-1111
+99 31 01111-0001
+99 13 10000-1110
11911110000
""" # Note: use the full list here