Skip to content

Instantly share code, notes, and snippets.

View wilyJ80's full-sized avatar
💭
🍪

Victor Hugo wilyJ80

💭
🍪
View GitHub Profile
@wilyJ80
wilyJ80 / .oxlintrc.json
Created October 26, 2026 18:01
oxlint rules for TS
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": [
"typescript",
"unicorn",
"oxc"
],
"categories": {
"correctness": "error"
},
@wilyJ80
wilyJ80 / home-test.js
Created October 19, 2026 19:39
rn integration test
import { render, fireEvent, waitFor, act } from '@testing-library/react-native';
import HomeScreen from '@/app/index';
it('fetches the API and displays its response in a modal', async () => {
const { getByTestId, queryByTestId } = await render(<HomeScreen />);
expect(queryByTestId('api-response')).toBeNull();
await act(async () => {
fireEvent.press(getByTestId('strawberry-button'));
@wilyJ80
wilyJ80 / rag.py
Created August 3, 2026 19:41
rerank rag
from pydantic import SecretStr
import requests
from pymupdf import pymupdf
from langchain_text_splitters import RecursiveCharacterTextSplitter
print("# 1. Load e Split do PDF")
file = pymupdf.open('./doc.pdf')
content = ""
content += file[0].get_text("text")
@wilyJ80
wilyJ80 / rerank.py
Created July 30, 2026 20:37
rerank test
import httpx
MAX_TOKENS = 2048
truncated_snippets = []
print('[INFO] Reading file...')
snippets = []
with open('./pacmanlog.txt', 'r') as f:
snippets = f.readlines()
@wilyJ80
wilyJ80 / main.py
Created July 27, 2026 17:18
llama cpp summarize with requests
from langchain_core.messages import SystemMessage, HumanMessage
from pydantic import SecretStr
from langchain_openai import ChatOpenAI
from langchain_text_splitters import RecursiveCharacterTextSplitter
from typing import cast
from pymupdf import pymupdf
print('[INFO] Loading text...')
doc = pymupdf.open('./report.pdf')
@wilyJ80
wilyJ80 / bak.sh
Last active August 1, 2026 22:49
backup
#!/bin/bash
# Fix paths for crontab
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
TARGET_DIR="/home/rubus/backups"
# Error handling
set -euo pipefail
trap cleanup ERR SIGINT SIGTERM
cleanup() {
@wilyJ80
wilyJ80 / main.py
Created July 13, 2026 19:14
llamacpp-summarize
from langchain_text_splitters import RecursiveCharacterTextSplitter
from llama_cpp import Llama, CreateChatCompletionResponse
from typing import cast
from pymupdf import pymupdf
print('[INFO] Loading text...')
doc = pymupdf.open('./report.pdf')
content = ''
for page in doc:
@wilyJ80
wilyJ80 / init.lua
Last active April 6, 2026 23:34
Neovim Config
-- Personal preferences
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.softtabstop = 4
-- Other custom required stuff
vim.opt.termguicolors = true
-- Set <space> as the leader key
-- See `:help mapleader`
@wilyJ80
wilyJ80 / text.json
Last active March 6, 2026 15:24
Supported FastEmbed models 2026 03
[
{
"model": "BAAI/bge-base-en",
"sources": {
"hf": "Qdrant/fast-bge-base-en",
"url": "https://storage.googleapis.com/qdrant-fastembed/fast-bge-base-en.tar.gz",
"_deprecated_tar_struct": true
},
"model_file": "model_optimized.onnx",
"description": "Text embeddings, Unimodal (text), English, 512 input tokens truncation, Prefixes for queries/documents: necessary, 2023 year.",
@wilyJ80
wilyJ80 / async.cpp
Created February 9, 2026 01:22
noblock async http
#include "esp32-hal-gpio.h"
#include <Arduino.h>
#include <WiFi.h>
#include <asyncHTTPrequest.h>
asyncHTTPrequest request;
unsigned long lastReq = 0;
const unsigned long interval = 5000;
void requestCB(void* optParm, asyncHTTPrequest* request, int readyState) {