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 isEmpty from "lodash/isEmpty"; | |
| class EncoderDecoderUtils{ | |
| constructor() { | |
| } | |
| encodeBase64(data: string): string{ | |
| return Buffer.from(data).toString('base64'); | |
| } |
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 kotlin.properties.ReadWriteProperty | |
| import kotlin.reflect.KProperty | |
| class RangeRegulator( | |
| initialValue: Int, | |
| private val minValue: Int, | |
| private val maxValue: Int, | |
| ) : ReadWriteProperty<Any?, Int> { | |
| var fieldValue = initialValue; |
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
| class FillInTheBlankQuestion { | |
| val questionText: String = "" | |
| val answer: String = "" | |
| val difficulty: String = "" | |
| } | |
| class TrueOrFalseQuestion { | |
| val questionText: String = "" | |
| val answer: Boolean = false | |
| val difficulty: String = "" |
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
| docker exec -it open-webui rm /app/backend/data/webui.db |
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 MyPick<T, K extends keyof T> = { | |
| [key in K]: T[key] | |
| } |
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 MyReadonly<T> = { | |
| readonly [A in keyof T]: T[A] | |
| } |
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
| // this version using any | |
| type TupleToObject<T extends readonly (keyof any)[]> = { | |
| [A in T[number]]: A | |
| } |
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 First<T extends any[]> = T extends [infer P, ...unknown[]] ? P : never; |
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 Length<T extends readonly unknown[]> = T['length'] |
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 MyExclude<T, U> = T extends U ? never: T; |