This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Allows us to call the script via git bp | |
[alias] | |
bp = !~/clean_merged_branches.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import subprocess | |
EXCLUDE = ["patrick-video-player-integration"] | |
GET_MERGED_BRANCHES = ["git", "branch", "--merged"] | |
DELETE_BRANCH = ["git", "branch", "--delete"] | |
PRUNE_ORIGIN = ["git", "remote", "prune", "origin"] | |
def runSubProc(proc): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main; | |
sealed class Maybe<A>(private val a: A?) { | |
class Just<A>(a: A) : Maybe<A>(a) { | |
override fun toString() = "Just(${wrapped()})" | |
} | |
class None<A> : Maybe<A>(null) { | |
override fun toString() = "None" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Opt<T> { | |
public interface Function<T> { | |
void apply(T object); | |
} | |
private final T object; | |
public Opt(T object) { | |
this.object = object; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Workaround for missing test resources when run unit tests within android | |
// studio. | |
// This copy the test resources next to the test classes for each variant. | |
// Tracked at https://github.com/nenick/AndroidStudioAndRobolectric/issues/7 | |
// Original solution comes from | |
// https://code.google.com/p/android/issues/detail?id=136013#c10 | |
// apply with: | |
// apply from: build.workaround-missing-resources.gradle | |
gradle.projectsEvaluated { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum Action { | |
ACTION1, ACTION2 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* within adapter class */ | |
private static class ItemDeletate<T> { | |
private final T item; | |
private boolean isViewed; | |
public ItemDelegate(T item) { | |
this.item = item; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package controller | |
public class Controller { | |
val editText : RxEditText<User> = // ... | |
val model : Model<User> = // ... | |
val modelObserver: Observer<User>? = null | |
val editTextObserver: Observer<User>? = null | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class MyValueObject(val a: Int, val b: String) |