Skip to content

Instantly share code, notes, and snippets.

View truefedex's full-sized avatar
🐢
working on some proprietary... 👎

Fedir Tsapana truefedex

🐢
working on some proprietary... 👎
View GitHub Profile
@truefedex
truefedex / clicker.py
Created June 22, 2024 08:56
Simple Android clicker on python
import os
for i in range(5000):
os.system("adb shell input tap 600 1600")
@truefedex
truefedex / gray_svg.py
Created May 20, 2024 07:30
Simple commandline sctipt to convert SVG to grayscale (without svg filters use)
import argparse
import xml.etree.ElementTree as ET
import os
import re
def rgb_to_grayscale(r, g, b):
"""Convert RGB to grayscale using the luminance formula."""
return round(0.299 * r + 0.587 * g + 0.114 * b)
def hex_to_rgb(hex_color):
@truefedex
truefedex / MainActivity.kt
Created June 5, 2023 18:05
Good old ListView with reusable elements
package com.example.mytestapplication
import android.app.ListActivity
import android.content.Context
import android.os.Bundle
import android.view.View
import android.view.ViewGroup
import android.widget.BaseAdapter
import android.widget.LinearLayout
import android.widget.TextView
@truefedex
truefedex / chua.js
Created March 19, 2020 11:05
Script for chess.com (can be pasted to development console while game) that highlights figures under attack
function chuaClearAllMarks() {
for (let x = 1; x < 9; x++) {
for (let y = 1; y < 9; y++) {
var elem = document.getElementsByClassName('piece square-0' + x + '0' + y);
if (elem.length > 0) {
if (elem[0].style.hasOwnProperty('backgroundColor') && elem[0].style.backgroundColor) {
elem[0].style.backgroundColor = null;
elem[0].style.animation = null;
console.log(elem[0].classList[1]);
}
@truefedex
truefedex / SimpleObservable.java
Created September 28, 2018 20:43
Just simple and more convenient replacement of java.util.Observable/Observer to implement observer pattern
package com.example;
import java.util.ArrayList;
import java.util.List;
/**
* Just simple and more convenient replacement of java.util.Observable/Observer
* to implement observer pattern
*/
public class SimpleObservable<T> {
@truefedex
truefedex / DebouncedClickListener.java
Created September 18, 2018 07:52
Simple solution for classic "debouncing" problem (ability of user to click simultaneously on several UI elements or fast clicking on one element with asynchronous result )
package com.example;
import android.support.annotation.NonNull;
import android.view.View;
/**
* Simple solution for classic "debouncing" problem (ability of user to click simultaneously
* on several UI elements or fast clicking on one element with asynchronous result )
*/
public abstract class DebouncedClickListener implements View.OnClickListener{
@truefedex
truefedex / Holder.java
Created October 13, 2017 17:10
holder
package com.brainwave_research_institute.app.brainwave.util;
/**
* Created by fedex on 13.10.17.
*/
public class Holder<T> {
public T value;
public Holder(T value) {