Skip to content

Instantly share code, notes, and snippets.

@StefMa
StefMa / FrameworkPlugin.kt
Created November 29, 2019 08:26
Apple Framework publishing via Gradle and the jfrog CLI
class FrameworkPlugin : Plugin<Project> {
override fun apply(project: Project): Unit = with(project) {
val zipFramework = tasks.register("zipFatFramework", Zip::class.java) {
it.dependsOn(tasks.named("releaseFatFramework"))
it.from("$buildDir/fat-framework")
it.archiveFileName.set("SomeFramework.framework.zip")
it.destinationDirectory.set(file("$buildDir/fat-framework-zip"))
}
@StefMa
StefMa / Dockerfile
Created March 1, 2019 13:06
Golang test basics
FROM golang:1.11.5-alpine3.8
WORKDIR /go/src/app
VOLUME WORKDIR
CMD ["go", "test"]
@StefMa
StefMa / build.gradle.kts
Created August 30, 2018 14:33
Gradle inferred task dependency
open class TestingTask : DefaultTask() {
@InputFiles
var inputDirs = mutableListOf<Task>()
@OutputDirectory
var out: File? = null
@TaskAction
fun createOutputDir() {
@StefMa
StefMa / README.md
Created July 29, 2018 12:58
Google Cloud Build

Google Cloud Build

To build your Android App on Google Cloud Build use the following config for your cloudbuild.yaml:

steps:
- name: 'stefma-docker-hub.bintray.io/android-build-env:0.2-alpha'
  args: [ 'bash', './gradlew', 'assembleRelease' ]

To manually run your project on Cloud Build just run:

@StefMa
StefMa / Dockerfile
Created March 20, 2018 07:55
Build Kotlin/Native with Docker
FROM fedora:27
RUN dnf -y install java-1.8.0-openjdk
RUN dnf -y install java-1.8.0-openjdk-devel
RUN dnf -y install git
RUN dnf -y install ncurses-compat-libs
RUN git clone https://github.com/JetBrains/kotlin-native.git source
WORKDIR "source"
RUN ./gradlew dependencies:update --no-daemon -i
@StefMa
StefMa / Result.md
Last active January 8, 2018 07:25
Kotlin Sequence

List Test:

Map Human(name=Stefan, age=12)
Map Human(name=Amy, age=1)
Filter Stefan
Filter Amy
[Stefan]
@StefMa
StefMa / build.gradle.kts
Created December 22, 2017 06:53
Kotlin DSL example
import com.novoda.gradle.release.PublishExtension
buildscript {
repositories {
jcenter()
}
dependencies {
classpath("com.novoda:bintray-release:0.8.0")
}
}
@StefMa
StefMa / Controllers.kt
Last active October 22, 2020 16:16
BottomNavigation with Conductor
private const val ROUTER_STATES_KEY = "STATE"
/**
* This is the base implementation of a [Controller] which works hand in hand with the [BottomNavigationView].
*
* It is designed to work like that:
* * [Textual explanation](https://i.imgur.com/EqqQyOY.png)
* * [Visual explanation](https://i.imgur.com/FDb6EGU.png)
*
* In other words. It should be behave exactly like the [iOS TabBar](http://apple.co/2y6XIrL)
@StefMa
StefMa / gist:3935064ea7dd7c51c23e243d8245af63
Created January 21, 2017 12:01
Firebase Cloud Message with Curl
# SERVER_KEY can be found under Overview -> Settings -> Cloud Messaging: ServerKey
curl https://fcm.googleapis.com/fcm/send -X POST --header "Authorization: key=SERVER_KEY" --Header "Content-Type: application/json" -d '
{
"to" : "FCM_TOKEN"
"data" : {
# Some Data
}
}'
@StefMa
StefMa / README.md
Last active September 20, 2016 17:11
StefDefault CodeStyle

StefDefault CodeStyle

My CodeStyle for IntelliJ and AS

####Default from AS 2.2

  • Field name prefix: m
  • Static field name prefix: s
  • Final local and parameters: true
  • Right margin: true (100) [Ensure right margin is not exceeded]
  • Keep getters & setters together