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 CSVRow<T> = Record<keyof T, string | number>; | |
// eslint-disable-next-line @typescript-eslint/no-explicit-any | |
class CSVParser<T = any> { | |
private rows: CSVRow<T>[]; | |
private header: (keyof T)[]; | |
constructor(csvData: string) { | |
this.rows = this.parseCSV(csvData); | |
this.header = this.rows.length > 0 ? (Object.keys(this.rows[0]) as (keyof T)[]) : []; |
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
from InquirerPy import prompt | |
import os | |
import psutil | |
customStyle = { | |
"question": "#cc00ff bold", | |
"pointer": "#ff9d00", | |
"answer": "#39a7e6 bold", | |
"fuzzy_match": "#2cf56c bold", |
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
// Initialize Depth First Search | |
// see https://en.wikipedia.org/wiki/Depth-first_search | |
const depthFirstSearch = (graph, source) => { | |
console.log(source); | |
for (let neighbour of graph.get(source)) { | |
depthFirstSearch(graph, neighbour); | |
} | |
}; |
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
/* | |
- NOTE TO THE READER - | |
This is the Discord bot command for making 3x3 grid guessing game. | |
□ □ □ | |
□ □ □ | |
□ □ □ | |
User guessing a position and responding in following structure "y x" | |
which y is row and x is column (e.g: 2 3 aka 2nd row 3th column) and it |