Skip to content

Instantly share code, notes, and snippets.

View Tapchicoma's full-sized avatar

Yahor Berdnikau Tapchicoma

View GitHub Profile
table base address: 0x5e300000
table version: 0x450005
Command 0x32(50) / table 0: [0, 8, 0, 0, 0]
Command 0x32(50) / table 1: [1, 8, 0, 0, 0]
Command 0x32(50) / table 2: [2, 8, 0, 0, 0]
Command 0x32(50) / table 3: [3, 8, 0, 0, 0]
Command 0x32(50) / table 4: [4, 8, 0, 0, 0]
Command 0x32(50) / table 5: [5, 8, 0, 0, 0]
Command 0x32(50) / table 6: [6, 8, 0, 0, 0]
Command 0x32(50) / table 7: [7, 8, 0, 0, 0]
@Tapchicoma
Tapchicoma / bootstrap.gradle
Last active March 27, 2019 15:47
Gradle modularization tricks
// You can have shared configuration for modules
// For example, pure kotlin modules can shared following kotlin-library-bootstrap.gradle
//###
apply plugin: 'java-library'
apply plugin: 'kotlin'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
@Tapchicoma
Tapchicoma / DownloadDependenciesTask.kt
Last active May 1, 2020 15:19
Download all Gradle project dependecies
import org.gradle.api.DefaultTask
import org.gradle.api.artifacts.Configuration
import org.gradle.api.attributes.Attribute
import org.gradle.api.model.ObjectFactory
import org.gradle.api.tasks.*
import org.gradle.kotlin.dsl.setProperty
import java.io.File
import javax.inject.Inject
/**
@Tapchicoma
Tapchicoma / KtEquals.kt
Created October 20, 2017 06:07
Kotlin common class equals
class MyClass(val a: Int, val b: Int, ... ) {
override fun equals(other: Any?) =
other is MyClass && compareValuesBy(this, other, MyClass::a, MyClass::b, ...) == 0
}
@Tapchicoma
Tapchicoma / build.gradle.kts
Created October 2, 2017 10:17 — forked from mkobit/build.gradle.kts
Run Kotlin REPL with built source code and main classpath in Gradle
// Assuming Kotlin plugin is applied...
// Run as: ./gradlew kotlinRepl --console plain --no-daemon
val kotlinRepl by tasks.creating {
dependsOn("assemble")
doFirst {
val buildscriptClasspath = rootProject.buildscript.configurations["classpath"]
val embeddedableCompiler = buildscriptClasspath
.resolvedConfiguration
@Tapchicoma
Tapchicoma / Transparency hex
Last active March 28, 2019 13:50
Transparency hex codes
Here's a correct table of percentages to hex values. E.g. for 50% white you'd use #80FFFFFF.
100% — FF
95% — F2
90% — E6
85% — D9
80% — CC
75% — BF
70% — B3
65% — A6
@Tapchicoma
Tapchicoma / java-package-rename.sh
Created December 28, 2012 08:43
Rename java package name in command line
#!/bin/sh
find . -name *.java -print | xargs sed -i 's/old\.package\.name/new\.package\.name/g'
@Tapchicoma
Tapchicoma / dostounix.sh
Created July 12, 2012 11:35
Convert all from dos to unix in current directory
find . -type f -exec sed -i 's/\x0d//g' {} \+