This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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: "[email protected]" }; | |
const personProxy = new Proxy(person, { |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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