Skip to content

Instantly share code, notes, and snippets.

View Elerphore's full-sized avatar
♣️

Eremey Malinovsky Elerphore

♣️
View GitHub Profile
@Elerphore
Elerphore / remove-yandex-music.js
Created March 19, 2024 07:03
Easy way to remove all liked playlists, albums and misuc on music.yandex.ru
let interval = 500;
[...document.getElementsByClassName("d-like__icon")].forEach((item, index) => {
setTimeout(() => {
item.click()
console.log(`click happend with inddex ${index}`)
}, interval * index)
})
[Display]
Mode=Fullscreen
FullscreenMode=Fullscreen
FullscreenRefresh=0
FullscreenWidth=2560
FullscreenHeight=1440
WindowedWidth=2560
WindowedHeight=1421
Maximized=0
RenderQuality=1.000000
import io.ktor.client.*
import io.ktor.client.engine.cio.*
import io.ktor.client.request.*
import io.ktor.http.*
import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking
import java.net.URL
val client = HttpClient(CIO) {}
data class ShittyChar(val char: Char, val pos: Int)
fun main() {
val symbols = mutableListOf(
ShittyChar('a', 0),
ShittyChar('A', 3),
ShittyChar('b', 0),
ShittyChar('A', 1),
ShittyChar('B', 0),
ShittyChar('A', 2),
data class ShittyChar(val char: Char, val pos: Int)
fun main() {
val symbols = mutableListOf(
ShittyChar('a', 0),
ShittyChar('A', 3),
ShittyChar('b', 0),
ShittyChar('A', 1),
ShittyChar('B', 0),
data class TreeNode(val value: Int, var left: TreeNode? = null, var right: TreeNode? = null)
fun main() {
val root: TreeNode = initBSTree()
val isBST: Boolean = isBST(root, Int.MIN_VALUE, Int.MAX_VALUE)
println(isBST)
}
val numbers = listOf(1, 2, 4, 5, 3, 6, 8, 7)
var max: Int
var i: Int
when(numbers.size % 2 != 0) {
true -> {
max = numbers[0]
i = 1
}
@Elerphore
Elerphore / Main.kt
Created December 30, 2022 16:45
Optimized prime number algorithm.
import kotlin.math.sqrt
fun main() {
val number = sqrt(17f).toInt()
var isPrime = true
for(i in 3 .. number step 2) {
if(number % i == 0) {
isPrime = false
}
@Elerphore
Elerphore / regex.txt
Created December 30, 2022 16:40
Regex which should inline a string with only one capital letter with no numbers and digits.
^[а-я]*[А-Я]{1}[а-я]*$
[
{
"command": "lsp_hover",
"keys": [
"alt+enter"
],
"context": [
{
"key": "lsp.session_with_capability",
"operator": "equal",