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
case class Apple(color: String) extends Fruit { | |
val isSour: Boolean = color == "green" | |
} |
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 JSONValue = | |
| string | |
| number | |
| boolean | |
| null | |
| JSONValue[] | |
| {[key: string]: JSONValue}; | |
type ParsedJSON = {[key: string]: JSONValue}; | |
function assertMatchesSchema<Schema extends yup.ObjectSchema>( |
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
/** | |
* Stricter version of `Omit`: | |
* Construct a type with the properties of T except for those in type K. | |
*/ | |
export type OmitStrict<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>; |
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
/** Any allowed JSON member value. */ | |
export type JSONValue = | |
| string | |
| number | |
| boolean | |
| null | |
| JSONValue[] | |
| {[key: string]: JSONValue}; | |
/** The generic result of parsing any valid JSON data. */ | |
export type ParsedJSON = Record<string, JSONValue>; |
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
function getSumOfSquaresOfDigits(n) { | |
let _n = n; | |
let result = 0; | |
while (_n > 0) { | |
result += (_n % 10) ** 2; | |
_n = Math.floor(_n / 10); | |
} | |
return result; | |
} |
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
C:\Windows\System32\SnippingTool.exe /clip |
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
interface ExampleQuery { | |
name?: string; | |
age?: number; | |
child?: { | |
id?: number; | |
name?: string; | |
}; | |
} | |
const GET = Symbol(); |
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
sc046::Media_Next | |
Pause::Media_Play_Pause |
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
/* eslint @typescript-eslint/no-var-requires: 0 */ | |
const gulp = require("gulp"); | |
const ts = require("gulp-typescript"); | |
const clean = require("gulp-clean"); | |
const replace = require("gulp-replace"); | |
const tsProject = ts.createProject("tsconfig.json"); | |
const paths = { | |
web: ["src/*.html", "src/*.css"] |
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
/** | |
* Promisified `parse()` from `csv-parse`. | |
* @param input The raw CSV data. | |
* @param options The options object to pass through to the `parse()` function. | |
* @returns Promise that resolves upon completion with an object containing the | |
* results and information about those results. | |
* @see {@link https://csv.js.org/parse/} For info about the options and info | |
* objects. | |
*/ | |
export function promiseParse( |
NewerOlder