Skip to content

Instantly share code, notes, and snippets.

View ixkor's full-sized avatar

Alexey Skoryatin ixkor

  • Serbia, Belgrade
View GitHub Profile
@ixkor
ixkor / sircc.py
Last active March 25, 2025 18:36
Smart IR codes converter
import argparse
import base64
import json
import itertools
import sys
import irgen
import heatshrink2
from construct import (
@ixkor
ixkor / RecyclerViewFlingFixer.java
Created April 1, 2020 08:36
Fix for RecyclerView fling issue (ignore first click after fling to end if RecyclerView in some NestedScrollingParent)
package ru.yandex.taxi.widget.recycler;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
public class RecyclerViewFlingFixer extends RecyclerView.OnFlingListener {
public static void addFlingFixer(@NonNull RecyclerView recyclerView) {
RecyclerViewFlingFixer flingFixer = new RecyclerViewFlingFixer();
recyclerView.setOnFlingListener(flingFixer);
@ixkor
ixkor / subtrees.sh
Created August 17, 2017 17:11 — forked from nikita240/subtrees.sh
Convert git submodules to git subtrees
#!/bin/bash -x
# This script will convert all your git submodules into git subtrees.
# This script ensures that your new subtrees point to the same commits as the
# old submodules did, unlike most other scripts that do this.
# THIS SCRIPT MUST BE PLACED OUTSIDE OF YOUR REPOSITORY!!!!!!!!!!
# Otherwise, the script will interfere with the git commits (unless you add it to .gitignore).
# Save the script in your home directory as `~/subtrees.sh`
# `cd` into your repository
# Run `~/subtrees.sh`
# Enjoy!
@ixkor
ixkor / ifAllNonNull.kt
Created May 4, 2017 11:27
Kotlin prevent several included "if"
inline fun <R, T1, T2> ifAllNonNull(item1: T1?, item2: T2?, block: (T1, T2) -> R)
= if (item1 != null && item2 != null) block(item1, item2) else null
inline fun <R, T1, T2, T3> ifAllNonNull(item1: T1?, item2: T2?, item3: T3?, block: (T1, T2, T3) -> R)
= if (item1 != null && item2 != null && item3 != null) block(item1, item2, item3) else null
inline fun <R, T1, T2, T3, T4> ifAllNonNull(item1: T1?, item2: T2?, item3: T3?, item4: T4?, block: (T1, T2, T3, T4) -> R)
= if (item1 != null && item2 != null && item3 != null && item4 != null) block(item1, item2, item3, item4) else null