Skip to content

Instantly share code, notes, and snippets.

View JonathanLoscalzo's full-sized avatar

Jonathan Loscalzo JonathanLoscalzo

View GitHub Profile
import './App.css';
import React, { useState, useEffect } from 'react';
// Implement an interface for drawing 2D bounding boxes on top of an image.
// Requirements:
// * The user should be able to click-and-drag on the image to draw a box.
// * Boxes should remain on the image after they are drawn.
// * Boxes should be able to overlap each other.
@JonathanLoscalzo
JonathanLoscalzo / docker-compose.yml
Created August 28, 2024 01:28
Postgres + PGAdmin
version: '3.9'
services:
db:
container_name: tabi_postgres
platform: linux/amd64/v8
image: postgres
restart: unless-stopped
shm_size: 128mb
volumes:
@JonathanLoscalzo
JonathanLoscalzo / suggested-folder.txt
Created August 25, 2024 19:48
suggested folder structure for fastapi+alembic project
fastapi-project
├── alembic/
├── src
│ ├── auth
│ │ ├── router.py # auth main router with all the endpoints
│ │ ├── schemas.py # pydantic models
│ │ ├── models.py # database models
│ │ ├── dependencies.py # router dependencies
│ │ ├── config.py # local configs
│ │ ├── constants.py # module-specific constants
@JonathanLoscalzo
JonathanLoscalzo / main.rs
Created August 22, 2024 22:26
rust - random things
// // strings3.rs
// //
// // Execute `rustlings hint strings3` or use the `hint` watch subcommand for a
// // hint.
// // I AM NOT DONE
// fn trim_me(input: &str) -> String {
// // TODO: Remove whitespace from both ends of a string!
// input.trim().to_string()
@JonathanLoscalzo
JonathanLoscalzo / .envrc
Created August 21, 2024 02:14
HOW TO RUN DOCKER IMAGES IN MAC M2 - For future generations
export DOCKER_DEFAULT_PLATFORM=linux/x86_64/v8
@JonathanLoscalzo
JonathanLoscalzo / llm-zoomcamp-homework-4-monitoring-2024.ipynb
Created August 19, 2024 00:50
LLM Zoomcamp - Homework 4 - Monitoring (2024).ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JonathanLoscalzo
JonathanLoscalzo / llm_zoomcamp_rag-homework.ipynb
Created July 16, 2024 20:14
LLM_zoomcamp_RAG - Homework.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Elastic Search

This document contains useful things about Elasticsearch

multi_match Query in Elasticsearch

The multi_match query is used to search for a given text across multiple fields in an Elasticsearch index.

It provides various types to control how the matching is executed and scored.

version: '3.8'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.14.1
container_name: elasticsearch
environment:
- bootstrap.memory_lock=true
- discovery.type=single-node
- xpack.security.enabled=false