Skip to content

Instantly share code, notes, and snippets.

View aiherrera's full-sized avatar
👨‍💻
Sr. Software Engineer (Remote)

Alain Iglesias aiherrera

👨‍💻
Sr. Software Engineer (Remote)
View GitHub Profile
@aiherrera
aiherrera / message.tsx
Last active October 10, 2023 08:53
Chat example - Message component
import { FC } from 'react'
export interface MessageProps {
message: string
sender: 'user' | 'ai'
}
const Message: FC<MessageProps> = ({ message, sender }) => {
const isUser = sender === 'user'
@aiherrera
aiherrera / embeddings-generator.ts
Last active January 6, 2024 04:31
Supabase EDGE Function - Embeddings generator
// Import the serve function to start a Deno server
import { serve } from "std/server";
// Import pipeline utility from Hugging Face Transformers
import { pipeline } from "transformers";
// Import Supabase client
import { createClient } from "supabase/client";
// Shared CORS headers
@aiherrera
aiherrera / settings.json
Last active July 2, 2023 03:09
VSCode personal settings
{
// Look & Feel
"editor.accessibilitySupport": "off",
"editor.indentSize": "tabSize",
"workbench.sideBar.location": "right",
"editor.fontSize": 15,
"debug.console.fontSize": 14,
"terminal.integrated.fontSize": 14,
"window.zoomLevel": 1,
"workbench.colorTheme": "Monokai Night",
@aiherrera
aiherrera / .gitignore
Created April 23, 2023 04:03
Git ignore configuration for supabase edge functions
.DS_Store
node_modules
.vscode
.idea
.vercel
# Supabase
**/supabase/.branches
**/supabase/.temp
@aiherrera
aiherrera / .prettierignore
Created April 23, 2023 03:51
Prettier ignore configuration for supabase edge functions
# prettier-plugin-sql-cst only supports sqlite syntax
**/supabase/migrations/*.sql
@aiherrera
aiherrera / .prettierrc
Last active April 23, 2023 03:50
Prettier configuration for supabase edge functions
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": false,
"singleQuote": true,
"printWidth": 100,
"endOfLine": "lf",
"sqlKeywordCase": "lower"
}
@aiherrera
aiherrera / react-expo.md
Created April 16, 2023 17:36
React Native Expo opinionated configuration

Personal project steps for setting React Native Expo environment

  1. For installing from a template: npx create-expo-app --template

Note: At the time of this gist you can select from:

  • Blank - a minimal app as clean as an empty canvas
  • Blank (TypeScript) - blank app with TypeScript enabled
  • Navigation (TypeScript) - several example screens and tabs using react-navigation and TypeScript
  • Blank (Bare) - blank app with the native code exposed (expo prebuild)
@aiherrera
aiherrera / locales_madrid_original.csv
Last active August 16, 2022 01:46
locales_madrid.csv
We can't make this file beautiful and searchable because it's too large.
_id;id_local;id_distrito_local;desc_distrito_local;desc_barrio_local;clase_vial_edificio;num_edificio;Cod_Postal;coordenada_x_local;coordenada_y_local;desc_situacion_local;Nombre;id_periodo_terraza;desc_periodo_terraza;id_situacion_terraza;desc_situacion_terraza;Superficie_ES;DESC_CLASE;DESC_NOMBRE;num_terraza;cal_terraza;desc_ubicacion_terraza;hora_ini_LJ_es;hora_fin_LJ_es;hora_ini_LJ_ra;hora_fin_LJ_ra;hora_ini_VS_es;hora_fin_VS_es;hora_ini_VS_ra;hora_fin_VS_ra;mesas_aux_es;mesas_aux_ra;mesas_es;mesas_ra;sillas_es;sillas_ra;;;;;;;;
7;280067128;20;SANBLAS-CANILLEJAS;ROSAS;CALLE;177;28022;448900,55;4474755,41;Abierto;SR;2;Estacional;1;Abierta;7,2;CALLE;SOFIA;177;A;Acera;8:00:00;1:30:00;;;8:00:00;1:30:00;;;0;;5;;10;A;;;;;;;;
32;270068967;4;SALAMANCA;RECOLETOS;CALLE;19;28001;441830,59;4475475,52;Abierto;JURUCHA;2;Estacional;1;Abierta;18,38;CALLE;AYALA;19;;Acera;8:00:00;1:30:00;;;8:00:00;1:30:00;;;0;;10;;20;;;;;;;;;
33;270403150;4;SALAMANCA;GUINDALERA;AVENIDA;2;28028;442586,58;4476524,51;Abierto;HONTANARES;1;Anua
@aiherrera
aiherrera / box_model_breaking_detector.js
Created April 14, 2021 21:50
Detector for elements who breaks the box model
const all_elements = document.getElementsByTagName("*");
let rect;
const offsetWidth = document.documentElement.offsetWidth;
for (let i = 0; i < all_elements.length; i++) {
rect = all_elements[i].getBoundingClientRect();
if (rect.right > offsetWidth || rect.left < 0){
// SHOW BREAKING ELEMENTS IN THE CONSOLE
console.log(all_elements[i]);
.caribbean-zoom {
#TT,
#LC,
#VC,
#KN,
#DO,
#JM,
#HT,
#GD,
#DM,