Skip to content

Instantly share code, notes, and snippets.

View tzkmx's full-sized avatar
🐓
Empezando una nueva ruta

Jesus Franco tzkmx

🐓
Empezando una nueva ruta
View GitHub Profile
@tzkmx
tzkmx / Word-Captura-Macros.ps1
Created September 24, 2025 18:53
Minimal utilities not longer allowed to write in macros
[CmdletBinding()]
param()
#--------------------------------------------------------------------------------
# UTILITY: ConvertTo-SpanishLongDate
# PURPOSE: Finds all cells in all tables containing only a date in dd/MM/yyyy
# format and converts it to a long Spanish date string.
# - Years before 2000 use "de" (e.g., 12 DE FEBRERO de 1989).
# - Years 2000 and after use "del" (e.g., 24 DE SEPTIEMBRE del 2025).
#--------------------------------------------------------------------------------
@tzkmx
tzkmx / Import-History.ps1
Last active September 20, 2025 16:44
PowerShell History on demand
function Invoke-ArchivedHistory {
[CmdletBinding()]
param (
[string]$Pattern,
[string]$HistoryFilePath = "$env:USERPROFILE\Scripts\session_history.csv"
)
if (-not (Test-Path $HistoryFilePath)) {
Write-Error "History file not found: $HistoryFilePath"
@tzkmx
tzkmx / commands_captura_limpia-folio-literal.toml
Created September 18, 2025 23:56
Custom cleaner Gemini commands
description = "Limpiar texto de folio corrigiendo errores y formato, preservando íntegramente frases y formalidades sin resumir ni reinterpretar."
prompt = """
Recibirás un texto extraído mediante OCR que puede contener errores de reconocimiento.
1. Corrige únicamente errores evidentes de ortografía y gramática, sin alterar el orden ni la literalidad de las frases.
2. Elimina encabezados repetitivos, números de página y elementos ajenos al cuerpo del documento **que no formen parte del acta o escritura**.
3. Unifica párrafos que pertenezcan a la misma idea, **pero nunca fusiones, modifiques, resumas, sintetices ni reinterpretes ningún acuerdo, párrafo o frase**.
4. Considera como **frases protegidas** (whitelist) las siguientes, que deben conservarse tal cual y en su posición original, aunque tengan variaciones menores por errores de OCR:
- “Previo el receso necesario…”, “Previo el receso de… minutos…”, “Se reanudó la sesión…”, “Se continuó con el siguiente punto del orden del día…”, “Acto conti
@tzkmx
tzkmx / Modelfile
Created September 9, 2025 00:10
Ollama local tests
FROM gguf
PARAMETER model-file gemma-3b-it-Q4_K_M.gguf
@tzkmx
tzkmx / autoCorrectionList.vb
Last active September 4, 2025 21:17
Lista de entradas de autocorrección (Macro de Word VBA)
Public Sub GenerarSoloConFormato()
Call AutoCorrectListFormatted(True)
End Sub
Public Sub GenerarListaAutocorreccion()
Call AutoCorrectListFormatted(False)
End Sub
Private Sub AutoCorrectListFormatted(Optional soloConFormato As Boolean = False)
Dim a As AutoCorrectEntry
@tzkmx
tzkmx / findings.md
Last active September 3, 2025 00:38
Moodle mini app embedded

Analysis of Moodle Dashboard Embedding Capabilities

This document summarizes the investigation into embedding custom JavaScript applications within a Moodle dashboard, showing the initial analysis and the final conclusion based on live testing.

Initial Analysis (Based on HTTP Headers and HTML)

  1. No Content-Security-Policy (CSP): The HTTP headers for the Moodle page were missing a Content-Security-Policy (CSP) header. A CSP header is the primary browser-level mechanism to control which external resources (like scripts) can be loaded. Its absence suggested that loading external scripts would be possible.

  2. HTML Sanitization Appears Minimal: An initial test of adding a simple HTML block with <div> and <h3> tags was successful, indicating that Moodle's own sanitization was not overly aggressive.

@tzkmx
tzkmx / LICENSE.txt
Created September 1, 2025 16:23
VBA Macro Password Recovery Procedure
The Artistic License 2.0
Copyright (c) 2000-2006, The Perl Foundation.
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
This license establishes the terms under which a given free software Package may be copied, modified, distributed, and/or redistributed. The intent is that the Copyright Holder maintains some artistic control over the development of that Package while still keeping the Package available as open source and free software.
You are always permitted to make arrangements wholly outside of this license directly with the Copyright Holder of a given Package. If the terms of this license do not permit the full use that you propose to make of the Package, you should contact the Copyright Holder and seek a different licensing arrangement.
Definitions
"Copyright Holder" means the individual(s) or organization(s) named in the copyright notice for the entire Package.
"Contributor" means any party that has contributed code or oth
@tzkmx
tzkmx / GEMINI_BEST_PRACTICES.md
Created August 22, 2025 22:39
gemini corrections

GEMINI Best Practices for Project Interaction

This document outlines a set of best practices for AI models when interacting with user projects. Adhering to these guidelines is critical for ensuring safety, consistency, and a productive collaboration.

1. Core Principles

  • User is the Priority: The user's instructions and feedback are the most important source of truth. If there is any ambiguity, ask for clarification rather than making an assumption.
  • Safety First: Never perform destructive actions (e.g., deleting files, modifying critical infrastructure) without explicit confirmation from the user. Always explain the potential impact of such actions before proceeding.
  • Clarity is Key: If the user's intent is unclear, ask for clarification. It is better to ask a question than to proceed with a wrong assumption.
@tzkmx
tzkmx / formDataToObject.ts
Created April 30, 2024 23:43
Extract from Next.js adapter for tRPC
/* eslint-disable @typescript-eslint/no-non-null-assertion */
function set(
obj: Record<string, any>,
path: string[] | string,
value: unknown,
): void {
if (typeof path === 'string') {
path = path.split(/[\.\[\]]/).filter(Boolean);
}
@tzkmx
tzkmx / handlerClass.ts
Last active April 23, 2024 23:39
Decorating App Router Route Handlers (next.js)
class HawkExperiment
{
async getEndpoint(request: Request, params: any)
{
// headers = array of key value pairs extracted from headers
let headers: {[p: string]: string} = {}
request.headers.forEach((val, key, allHeaders) => {
headers[key] = val
})
return Response.json({