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 Comparable = number | string | Date | boolean | bigint | |
type CompareOp = "<" | ">" | "<=" | ">=" | "===" | "!==" | |
const compareFns: Readonly< | |
Record<CompareOp, <T extends Comparable>(a: T, b: T) => boolean> | |
> = { | |
"<": (a, b) => a < b, | |
"<=": (a, b) => a <= b, | |
">": (a, b) => a > b, |
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
package lib.xml | |
import org.apache.commons.text.StringEscapeUtils | |
fun StringBuilder.put(attrs: Array<out Pair<String, Any?>>) { | |
for ((k, v) in attrs) { | |
if (v == null) continue | |
append(' ') | |
append(k) |
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
const productContainer = document.querySelector('div[data-qa-locator="general-products"]'); | |
const sortedEls = Array.from(productContainer.children) | |
.flatMap(product => { | |
const salesInfo = product.querySelector('._1cEkb'); | |
if (!salesInfo) return []; | |
const salesText = salesInfo.innerText; | |
const [soldStr] = salesText.split(' ') | |
const salesCount = parseInt(soldStr.replace(",", "")); |
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
DIR:=gen/ | |
openapi: | |
rm -rf $(DIR) | |
openapi-generator generate -g typescript-fetch -i http://localhost:8080/openapi.json -o $(DIR) --remove-operation-id-prefix --additional-properties=typescriptThreePlus=true,modelPropertyNaming=original,nullSafeAdditionalProps=true,enumPropertyNaming=original,supportsES6=true,useSingleRequestParameter=false | |
grep -rl "? undefined" $(DIR) | xargs sed -i '' 's/? undefined/? null/g' |
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
[tool.poetry] | |
version = "1.0.0" | |
name = "gpt-2" | |
description = "" | |
authors = [] | |
[tool.poetry.dependencies] | |
fire = "^0.1.3" | |
regex = "2017.4.5" | |
requests = "2.21.0" |
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
jq '.dependencies | keys | .[]' package.json | xargs yarn add | |
jq '.devDependencies | keys | .[]' package.json | xargs yarn add --dev |
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
! 2/5/2020 https://twitter.com | |
twitter.com##div[aria-label$="Your Home Timeline"] | |
twitter.com##div[aria-label$="Trending now"] | |
twitter.com##aside[aria-label$="Who to follow"] | |
twitter.com##a[aria-label^="Home"] | |
twitter.com##a[aria-label$="explore"] | |
twitter.com##a[aria-label^="Notifications"] | |
twitter.com##a[aria-label^="Bookmarks"] | |
twitter.com##a[aria-label^="Lists"] | |
twitter.com##a[aria-label^="Profile"] |
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 kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.Job | |
import kotlinx.coroutines.launch | |
import kotlinx.coroutines.time.delay | |
import mu.KotlinLogging | |
import java.time.Duration | |
private val log = KotlinLogging.logger { } | |
data class PeriodicJob( |
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 kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.Dispatchers | |
import kotlinx.coroutines.cancel | |
import kotlinx.coroutines.launch | |
import kotlinx.coroutines.suspendCancellableCoroutine | |
import java.io.StringWriter | |
sealed class Cli { | |
data class Ok(val stdout: String) : Cli() | |
data class Err(val stderr: String) : Cli() |
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
enum ColumnType: String, Codable { | |
case line | |
case x | |
case area | |
case bar | |
} | |
typealias LineId = String | |
struct Columns { |
NewerOlder