Skip to content

Instantly share code, notes, and snippets.

View JoaquinRuiz's full-sized avatar

Joaquín Ruiz JoaquinRuiz

View GitHub Profile
@JoaquinRuiz
JoaquinRuiz / gist:19c1d9f374bb6b05c291bf44c4fae9b5
Created January 16, 2026 19:48
Ollama configuration (llama3.2) for Wave Terminal
{
"ollama-llama": {
"display:name": "Ollama - llama3.2",
"display:order": 1,
"display:icon": "microchip",
"display:description": "Local llama3.2:latest model via Ollama",
"ai:apitype": "openai-chat",
"ai:model": "llama3.2:latest",
"ai:thinkinglevel": "medium",
"ai:endpoint": "http://localhost:11434/v1/chat/completions",
@JoaquinRuiz
JoaquinRuiz / app.py
Created December 12, 2025 19:49
RAG Local con Ollama y Python: Crea tu propio ChatGPT privado (Código del Tutorial de Youtube) https://youtu.be/sj1yzbXVXM0?si=xgB6NVUKMmESCQmW
import os
import bs4
from langchain_community.document_loaders import WebBaseLoader
from langchain_community.vectorstores import Chroma
from langchain_ollama import OllamaEmbeddings
from langchain_ollama import OllamaLLM
from langchain_text_splitters import RecursiveCharacterTextSplitter
# defino user agent para evitar bloqueos
os.environ["USER_AGENT"] = "Mañobot/1.0"
@JoaquinRuiz
JoaquinRuiz / replace-tilde.php
Created June 22, 2019 16:49
replace tilde php without codification
$unwanted_array = array( 'Š'=>'S', 'š'=>'s', 'Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E',
'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U',
'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss', 'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c',
'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o',
'ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'þ'=>'b', 'ÿ'=>'y' );
$str = strtr( $str, $unwanted_array );
@JoaquinRuiz
JoaquinRuiz / ajax-json.html
Created February 22, 2019 17:20
AJAX and JSON guide for beginners
<button type="button" onclick="getJSON()">Get the users</button>
<table id="users"></div>
<script>
function getJSON() {
var ajax_req = new XMLHttpRequest();
ajax_req.open('GET', 'https://api.github.com/users', true);
ajax_req.onload = function() {
//status 200 means everything is ok