Skip to content

Instantly share code, notes, and snippets.

View Takhion's full-sized avatar

Eugenio Marletti Takhion

View GitHub Profile
@Takhion
Takhion / TwitterHandle.kt
Last active February 20, 2020 15:44 — forked from raulraja/TwitterHandle.kt
Type Refinements with Type Proofs in Kotlin
/* Coming up ~ April 2020 */
package test
import arrow.*
inline class TwitterHandle
@Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS")
private constructor(val handle: String) {
companion object : Refined<String> {
override val validate: String.() -> Map<String, Boolean> = {
@Takhion
Takhion / sort-commits-for-github.sh
Created November 9, 2019 17:22 — forked from findepi/sort-commits-for-github.sh
sort commits for GitHub's sake
git rebase "$(git merge-base HEAD master)" -x 'git commit --amend -C HEAD --date="$(date -R)" && sleep 1.05'
@Takhion
Takhion / RxFilterIsInstance.kt
Last active June 29, 2020 17:04 — forked from rock3r/RxFilterIsInstance.kt
Port Kotlin's awesome filterIsInstance() to RxJava — one call to filter by type and map-cast to that type
package me.seebrock3r.extensions.reactivex
import io.reactivex.Flowable
import io.reactivex.Maybe
import io.reactivex.Observable
import io.reactivex.Single
@Suppress("UNCHECKED_CAST") // The cast happens after we filter by type so it's safe
inline fun <reified R> Flowable<*>.filterIsInstance(): Flowable<R> =
filter { it is R }
@Takhion
Takhion / facebook-photo-download.go
Last active March 24, 2018 17:03 — forked from thebitguru/facebook-photo-download.go
A simple go program to download all the high resolution pictures from your facebook albums.
package main
/*
* A simple go program to download all the high resolution pictures from your facebook albums.
*
* To run this:
* 1. Go to https://developers.facebook.com/tools/explorer/?method=GET&path=me&version=v2.8
* 2. Get an Access Token: Get Token > Get User Access Token > Check "user_photos"
* 3. Paste in the app.
*/
@Takhion
Takhion / gorun.go
Created March 24, 2018 17:00 — forked from mattn/gorun.go
//
// gorun - Script-like runner for Go source files.
//
// https://wiki.ubuntu.com/gorun
//
// Copyright (c) 2011 Canonical Ltd.
//
// Written by Gustavo Niemeyer <gustavo.niemeyer@canonical.com>
//
package main
@Takhion
Takhion / build.gradle
Last active May 28, 2020 11:13 — forked from dmarcato/strip_play_services.gradle
Gradle task to strip unused packages on Google Play Services library, so you don't have to use necessarily Proguard or MultiDex
apply from: 'strip_play_services.gradle'
@Takhion
Takhion / build.gradle
Last active December 20, 2017 07:35 — forked from gabrielemariotti/build.gradle
Store APK signing credentials in an external file using Gradle
android {
signingConfigs {
release
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}