Skip to content

Instantly share code, notes, and snippets.


Jean-Michel Fayard jmfayard

View GitHub Profile
View runOnGitHub.yml
# .github/workflows/runOnGitHub.yml
# GitHub Actions documentation
# =>
name: runOnGitHub
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
branches: [ master, main ]
jmfayard / cloudSettings
Last active Nov 29, 2019
Visual Studio code
View cloudSettings
View android-camera-samples-fragment.kt
public inline fun needsRefactoring(): Nothing = throw NotImplementedError("""
This does too much and needs to be refactored.
Don't put any kind of logic in the Activities and Fragments.
class Camera2BasicFragment : Fragment(), View.OnClickListener,
ActivityCompat.OnRequestPermissionsResultCallback {
private val surfaceTextureListener = object : TextureView.SurfaceTextureListener {
override fun onSurfaceTextureAvailable(texture: SurfaceTexture, width: Int, height: Int) = needsRefactoring()
jmfayard / stacktrace.txt
Created Sep 6, 2019
Cannot change dependencies of configuration ':classpath' after it has been resolved.
View stacktrace.txt
$ cd sample-kotlin
$ gw --stacktrace dependencyUpdates
executing gradlew instead of gradle
> Task :dependencyUpdates FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':dependencyUpdates'.
> Cannot change dependencies of configuration ':classpath' after it has been resolved.
View MoshiAdapters.kt
object MoshiAdapters {
val moshi : Moshi = Moshi.Builder().build()
inline fun <reified T: Any> moshiAdapter(clazz: Class<T> = Lazy<JsonAdapter<T>>
= lazy { moshi.adapter(clazz) }
val movie: JsonAdapter<Movie> by moshiAdapter()
val user: JsonAdapter<User> by moshiAdapter()

i was thinking how to integrate it with the newest feature

we could have

rejectVersionContaining ("alpha","beta",...)

which would be a shorter version of

jmfayard / 1.kt
Last active Sep 22, 2019
Gradle buildSrcVersions
View 1.kt
/** buildSrc/src/main/kotlin/Libs.kt **/
object Libs {
const val okhttp = "com.squareup.okhttp3:okhttp:" + Versions.okhttp
const val okio = "com.squareup.okio:okio:" + Versions.okio
//... all others
/** buildSrc/src/main/kotlin/Versions.kt **/
object Versions {
const val okhttp = "3.12.1"
You can’t perform that action at this time.