Skip to content

Instantly share code, notes, and snippets.

View jasonjimnz's full-sized avatar

Jason Jiménez Cruz jasonjimnz

View GitHub Profile
@jasonjimnz
jasonjimnz / r2r_duckdb.py
Created September 8, 2025 22:08
RDS to Redshift with DuckDB Workarounds
import duckdb
import psycopg2
import boto3
import json
import os
import sys
# --- Configuration: Please fill in these values ---
# PostgreSQL RDS Connection Details
PG_HOST = "your-rds-endpoint.region.rds.amazonaws.com"
@jasonjimnz
jasonjimnz / mltesting.py
Created September 8, 2025 10:18
Python code for testing movie recommender
# -*- coding: utf-8 -*-
"""mltesting.ipynb
Automatically generated by Colab.
Original file is located at
https://colab.research.google.com/gist/jasonjimnz/beef70edd7bd7a592df795603460a0d2/mltesting.ipynb
"""
# %pip install pandas faker scikit-learn duckdb joblib # Install libs
@jasonjimnz
jasonjimnz / python_algorithms.py
Created September 6, 2025 16:43
Python algorithm collection
"""
This file contains Python implementations and tests for the following algorithms:
1. Binary Search
2. KMP String Search
3. Quick Sort
4. Merge Sort
5. Fast Fourier Transform (FFT)
6. Depth-First Search (DFS)
7. Breadth-First Search (BFS)
8. Topological Sort
@jasonjimnz
jasonjimnz / db_tools.py
Created July 16, 2025 21:29
Big datas de esos
import psycopg2
POSTGRES_CREDS = {
"host": "localhost",
"user": "postgres",
"password": "postgres",
"port": 5432,
"dbname": "bigdata"
}
@jasonjimnz
jasonjimnz / Dockerfile
Created February 24, 2025 20:19
Local ETL arch, for starting with a complete pipeline using AI services
# dagster/Dockerfile
FROM python:3.12-bullseye
ENV DAGSTER_HOME=/opt/dagster/dagster_home/
RUN mkdir -p $DAGSTER_HOME
WORKDIR $DAGSTER_HOME
COPY dagster $DAGSTER_HOME
@jasonjimnz
jasonjimnz / Dockerfile
Created November 3, 2024 22:24
Playing with Jinja and Apache2 (under Alpine)
FROM python:3.12-alpine
# Get some fun in https://labs.play-with-docker.com/ you can use docker compose if you want
WORKDIR /opt/app
COPY . .
# Make sure that you have output_html folder
# RUN mkdir output_html # Uncomment if you don't have the folder
RUN apk update && apk add apache2
RUN chmod +x /opt/app/web_generator.sh
@jasonjimnz
jasonjimnz / home.html
Created August 28, 2024 22:52
Basic LM Studio API handler
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>LLM Chat</title>
</head>
<body>
<div class="container">
<h1>Chatbot tester</h1>
<div class="form-container">
@jasonjimnz
jasonjimnz / mysql-compose.yml
Created February 19, 2024 19:07
A Docker compose ready to be used for running MySQL in local environment
# Use root/example as user/password credentials
version: '3.1'
services:
# If you want to run only the MySQL just run
# docker-compose -f mysql-compose.yml up db
# or
# docker compose -f mysql-compose.yml up db
db:
image: mysql
@jasonjimnz
jasonjimnz / latency.txt
Created August 15, 2023 13:25 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@jasonjimnz
jasonjimnz / odoo_apache.md
Created February 13, 2017 18:05
Instalación y configuración de [Odoo 8.0 + Apache + mod_wsgi] en entornos de producción

##Instalación y configuración de [Odoo 8.0 + Apache + mod_wsgi] en entornos de producción Guía de instalación de Odoo 8.0 en entornos GNU/Linux con Apache y mod_wsgi como puerta de enlace. ###El cuento corto NOTA: En ésta guía rápida no se explican los comandos básicos de bash ni el sistema de archivos de entornos GNU/Linux. ####Instalación de las dependencia y recomendaciones de Odoo para la versión 8.0

$ aptitude install adduser postgresql-client python python-dateutil python-decorator python-docutils python-feedparser python-imaging python-jinja2 python-ldap python-libxslt1 python-lxml python-mako python-mock python-openid python-passlib python-psutil python-psycopg2 python-pybabel python-pychart python-pydot python-pyparsing python-pypdf python-reportlab python-requests python-simplejson python-tz python-unittest2 python-vatnumber python-vobject python-werkzeug python-xlwt python-yaml antiword graphviz ghostscript postgresql python-gevent poppler-utils git libapache2-mod-wsgi

####Configuración de Po