Skip to content

Instantly share code, notes, and snippets.

Avatar

Adel Nizamutdinov meoyawn

View GitHub Profile
@meoyawn
meoyawn / pyproject.toml
Created Jul 30, 2020
gpt-2 dependencies
View pyproject.toml
[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"
@meoyawn
meoyawn / yarn.sh
Created Jul 24, 2020
update package.json using yarn
View yarn.sh
jq '.dependencies | keys | .[]' package.json | xargs yarn add
jq '.devDependencies | keys | .[]' package.json | xargs yarn add --dev
View ublock
! 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"]
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
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
import java.io.StringWriter
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
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.app.Activity
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,
View MainActivity.java
import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import org.opencv.android.CameraBridgeViewBase;
import org.opencv.android.JavaCameraView;
import org.opencv.android.OpenCVLoader;
import org.opencv.core.Mat;
import org.opencv.core.MatOfRect;
@meoyawn
meoyawn / tat.py
Created Apr 22, 2017
translate between tatar and russian from CLI
View tat.py
#!/usr/bin/env python3
import sys
from urllib.parse import quote
from lxml import html
if len(sys.argv) > 1:
word = sys.argv[1]
You can’t perform that action at this time.