This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from dotenv import load_dotenv | |
from langchain.chains import RetrievalQA | |
from langchain.embeddings import HuggingFaceEmbeddings | |
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler | |
from langchain.vectorstores import Chroma | |
from langchain.llms import GPT4All, LlamaCpp | |
import os | |
import argparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type SquareEvent = { type: "square", x: number, y: number }; | |
type CircleEvent = { type: "circle", radius: number }; | |
type EventType = SquareEvent | CircleEvent; | |
type Events = { | |
square: SquareEvent; | |
circle: CircleEvent; | |
} | |
type ListenersMap = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"import/order": ['warn', { | |
'groups': ['builtin', 'external', 'internal', 'parent', 'sibling'], | |
'alphabetize': { | |
order: 'asc' | |
}, | |
"pathGroups": [ | |
{ | |
"pattern": "react", | |
"group": "builtin", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************************ | |
* | |
* 💪🏼💪🏼💪🏼 Javascript Proxy 💪🏼💪🏼💪🏼 | |
* | |
************************************************************/ | |
// 1️⃣ Performing an action when accesing a property | |
const person = { name: "Gerardo", email: "gerardo@latteandcode.com" }; | |
const personProxy = new Proxy(person, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************************** | |
* | |
* 🗺️🗺️🗺️ Map 🗺️🗺️🗺️ | |
* Performs better in scenarios involving frequent additions and | |
* removals of key-value pairs. | |
* | |
********************************************************************************/ | |
// 1️⃣ Main methods |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**************************************************************** | |
* | |
* 🍰🍰🍰 Array slice 🍰🍰🍰 | |
* | |
****************************************************************/ | |
const animals = ['🐶', '🐱', '🐭', '🐻', '🦁']; | |
// Remove first element | |
console.log(animals.slice(1)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**************************************************************** | |
* | |
* 🤹🏻♂️🤹🏻♂️🤹🏻♂️ Object & Entries 🤹🏻♂️🤹🏻♂️🤹🏻♂️ | |
* | |
****************************************************************/ | |
/** | |
* 1️⃣ Object.entries | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************************************** | |
* | |
* 🐖🐂🐄🐓 George Orwell explaining Javascript Prototype 🐖🐂🐄🐓 | |
* | |
**************************************************************************/ | |
function Animal(name, type) { | |
this.name = name; | |
this.type = type; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************ | |
* | |
* 📩📩📩 window.postMessage() 📩📩📩 | |
* | |
* The window.postMessage() method safely enables cross-origin communication | |
* between Window objects; e.g., between a page and a pop-up that it spawned, | |
* or between a page and an iframe embedded within it. | |
* | |
************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/****************************************************************************************************** | |
* | |
* 🆙🆙🆙🆙 Variable hoisting 🆙🆙🆙🆙 | |
* | |
* Característica del lenguaje que de forma automática la declaración de las variables | |
* a la parte superior del bloque funcional / global | |
* | |
*******************************************************************************************************/ | |
console.log(user); // "undefined" pero no da error |
NewerOlder