Skip to content

Instantly share code, notes, and snippets.

View epool's full-sized avatar

Eduardo Pool epool

  • Bitso
  • Mérida, México
View GitHub Profile
@epool
epool / stash_dropped.md
Created December 28, 2020 23:04 — forked from joseluisq/stash_dropped.md
How to recover a dropped stash in Git?

How to recover a dropped stash in Git?

1. Find the stash commits

git log --graph --oneline --decorate ( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )

This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph.

@epool
epool / BuildXcFramework.kt
Last active December 5, 2023 13:11
Builds a XcFramework from a shared module in KMM.
//region XcFramework tasks
val xcFrameworkPath = "xcframework/${project.name}.xcframework"
tasks.create<Delete>("deleteXcFramework") { delete = setOf(xcFrameworkPath) }
val buildXcFramework by tasks.registering {
dependsOn("deleteXcFramework")
group = "build"
val mode = "Release"
val frameworks = arrayOf("iosArm64", "iosX64")
@epool
epool / SpanningGridLayoutManager.java
Created March 2, 2020 05:45 — forked from heinrichreimer/SpanningGridLayoutManager.java
GridLayoutManager implementation that stretches to fit all grid items on screen and disables scrolling. Useful for dashboards etc.
package com.example;
import android.content.Context;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.ViewGroup;
public class SpanningGridLayoutManager extends GridLayoutManager {
@epool
epool / LiveDataReactiveStreamsActivity.kt
Created September 13, 2018 05:28 — forked from arekolek/LiveDataReactiveStreamsActivity.kt
Using LiveDataReactiveStreams to handle lifecycle and threading while computing list diff for recycler view
package com.github.arekolek.diffutil
import android.arch.lifecycle.*
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.support.v7.util.DiffUtil
import android.support.v7.widget.RecyclerView
import android.util.Log
import android.view.LayoutInflater
import android.view.View
...
mainClassName = 'org.jetbrains.ktor.netty.DevelopmentHost'
kotlin {
experimental {
coroutines "enable"
}
}
...
@epool
epool / PikmailApiMain.kt
Created January 8, 2018 20:25
Simplified main method of the Pikmail API
@JvmStatic
fun main(args: Array<String>) {
val port = System.getenv("PORT")?.toInt() ?: 8080
embeddedServer(Netty, port) {
routing {
static {
staticRootFolder = File("./static")
files("./")
default("index.html")
}
@epool
epool / PikmailInvalidEmailTest.kt
Created January 5, 2018 23:11
Pikmail Invalid Email Test
object PikmailTest : Spek({
given("a Pikmail object") {
on("get a profile for an invalid Gmail address") {
val invalidGmailAddress = "test@mail.com"
val testObservable = Pikmail.getProfile(invalidGmailAddress).test()
it("should throw a ProfileNotFountException") {
@epool
epool / kotlin-non-blocking.kt
Created January 5, 2018 22:41
Kotlin Non-Blocking
Pikmail.getProfile("eduardo.alejandro.pool.ake@gmail.com")
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
{ println(it.toString()) },
{ println(it.cause.toString()) }
)
@epool
epool / kotlin-blocking.kt
Created January 5, 2018 22:40
Kotlin Blocking
val profile = Pikmail.getProfile("eduardo.alejandro.pool.ake@gmail.com").blockingGet()
profile.profilePictureUrl
profile.resizeProfilePictureUrl(500)
profile.nickname
// OR
Pikmail.getProfilePictureUrl(email).blockingGet()
Pikmail.getProfilePictureUrl(email, 500).blockingGet()
Pikmail.getProfileNickname(email).blockingGet()

PairAndroid

Pair programming for Android candidates

Environment Setup

For this you will need:

  1. Android Studio 3.+
  2. Android SDK for 7.0+ (API 24)
  3. A handset virtual machine with Nougat (API 24) installed. We recommend one based on the Nexus 6P.