Skip to content

Instantly share code, notes, and snippets.

🗣️
Mobius time!

Stepan Goncharov stepango

🗣️
Mobius time!
Block or report user

Report or block stepango

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View build.gradle
subprojects {
afterEvaluate {
if (project.hasProperty('kapt')) kapt {
javacOptions {
option("-source", "8")
option("-target", "8")
}
}
}
}
@stepango
stepango / error.log
Created Oct 14, 2019
Java 11 KAPT error
View error.log
> Task :app:compileDebugJavaWithJavac FAILED
/Users/stepango/AndroidStudioProjects/Java11/app/build/generated/source/kapt/debug/com/stepango/java11/di/DaggerRootComponent.java:4: error: package javax.annotation.processing does not exist
import javax.annotation.processing.Generated;
^
/Users/stepango/AndroidStudioProjects/Java11/app/build/generated/source/kapt/debug/com/stepango/java11/di/DaggerRootComponent.java:6: error: cannot find symbol
@Generated(
^
symbol: class Generated
2 errors
@stepango
stepango / RootComponent.kt
Created Oct 13, 2019
Simple Dagger Root Component
View RootComponent.kt
import dagger.Component
@Component
interface RootComponent {
fun inject(app: MainActivity)
}
@stepango
stepango / git_diff.sh
Created Oct 2, 2019
Git diff between master and current branch
View git_diff.sh
git diff $(git merge-base master $(git rev-parse --abbrev-ref HEAD))
@stepango
stepango / rfinder.py
Created Oct 2, 2019
Find all empty R.java files
View rfinder.py
import os
path = os.path.dirname(os.path.realpath(__file__))
pattern = """public final class R {
private R() {}
}"""
# r=root, d=directories, f = files
@stepango
stepango / build.gradle
Created Sep 21, 2019
Call Bazel from Gradle
View build.gradle
apply plugin: 'java'
buildDir = "gradleBuild"
def buildBazel = tasks.register("buildBazel", Exec) {
finalizedBy(tasks.named("compileJava"))
workingDir '../'
commandLine 'bazel', 'build', '//' + project.name + ":bali"
}
@stepango
stepango / rmbuild.sh
Created Nov 17, 2018
Remove all build folders
View rmbuild.sh
rm -rf `find . -type d -name build`
@stepango
stepango / ObservableFields.kt
Created Jul 19, 2018
Observable fields mapping
View ObservableFields.kt
val nameText = ObservableBoolean(nameHint) { it.isEmpty() }
fun <T: Any> ObservableBoolean(o: ObservableField<T>, f:(T) -> Boolean): ObservableBoolean {
return ObservableBoolean()
.apply {
o.observe {
this.set(f(it!!))
}
}
}
@stepango
stepango / build.gradle
Last active Jun 23, 2018
Alternative build dir
View build.gradle
// your_project_folder/build.gradle
allprojects {
if (new File("your_ram_disk_path").exists())
buildDir = "your_ram_disk_path/build/${rootProject.name}/${project.name}"
}
@stepango
stepango / hfs.sh
Last active Jun 23, 2018
In-Memory HFS+
View hfs.sh
# OSX 4Gb with `RAMDisk` name
diskutil erasevolume HFS+ 'RAMDisk' `hdiutil attach -nomount ram://8388608`
You can’t perform that action at this time.