Skip to content

Instantly share code, notes, and snippets.

meoyawn / pyproject.toml
Created Jul 30, 2020
gpt-2 dependencies
View pyproject.toml
version = "1.0.0"
name = "gpt-2"
description = ""
authors = []
fire = "^0.1.3"
regex = "2017.4.5"
requests = "2.21.0"
meoyawn /
Created Jul 24, 2020
update package.json using yarn
jq '.dependencies | keys | .[]' package.json | xargs yarn add
jq '.devDependencies | keys | .[]' package.json | xargs yarn add --dev
View ublock
! 2/5/2020[aria-label$="Your Home Timeline"][aria-label$="Trending now"][aria-label$="Who to follow"][aria-label^="Home"][aria-label$="explore"][aria-label^="Notifications"][aria-label^="Bookmarks"][aria-label^="Lists"][aria-label^="Profile"]
View periodic.kt
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(
meoyawn / cli.kt
Last active Oct 28, 2019
Calling CLI tools using kotlin coroutines with cancellation support
View cli.kt
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
import kotlinx.coroutines.suspendCancellableCoroutine
sealed class Cli {
data class Ok(val stdout: String) : Cli()
data class Err(val stderr: String) : Cli()
View json.swift
enum ColumnType: String, Codable {
case line
case x
case area
case bar
typealias LineId = String
struct Columns {
meoyawn / multitouch.kt
Last active Apr 5, 2019
Android multitouch helper
View multitouch.kt
import android.view.MotionEvent
typealias PxF = Float
typealias X = PxF
typealias Y = PxF
typealias PointerId = Int
inline fun MotionEvent.multiTouch(
View ActivityResult.kt
import android.content.Intent
import android.os.Bundle
import kotlinx.coroutines.experimental.suspendCancellableCoroutine
typealias RequestCode = Int
typealias ResultCode = Int
data class ActivityResult(
val requestCode: RequestCode,
import android.os.Bundle;
import org.opencv.core.Mat;
import org.opencv.core.MatOfRect;
meoyawn /
Created Apr 22, 2017
translate between tatar and russian from CLI
#!/usr/bin/env python3
import sys
from urllib.parse import quote
from lxml import html
if len(sys.argv) > 1:
word = sys.argv[1]