Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
awesome stuff

Iiro Krankka roughike

🎯
awesome stuff
View GitHub Profile
@roughike
roughike / multi_isolate_webserver.dart
Created Feb 10, 2020
A simple dart webserver that distributes multiple connections across 6 Isolates.
View multi_isolate_webserver.dart
import 'dart:io';
import 'dart:isolate';
void main() async {
for (var i = 1; i < 6; i++) {
Isolate.spawn(_startServer, []);
}
// Bind one server in current Isolate
_startServer();
View RealmTestRule.kt
package com.example.myawesomeapp
import io.realm.Realm
import io.realm.RealmConfiguration
import org.junit.rules.ExternalResource
import org.junit.runner.Description
import org.junit.runners.model.Statement
/**
* A JUnit Rule that sets up a test Realm database before each test,
@roughike
roughike / jacoco.gradle
Created Aug 8, 2016 — forked from danielgomezrico/jacoco.gradle
Gradle - jacoco gradle file that is setup to run tests and create test coverage reports for Android (junit tests or connectedTests...). apply to your project and check "reporting" in gradle tasks. Thanks to https://github.com/artem-zinnatullin/qualitymatters for it.
View jacoco.gradle
project.afterEvaluate {
// Grab all build types and product flavors
def buildTypes = android.buildTypes.collect { type -> type.name }
def productFlavors = android.productFlavors.collect { flavor -> flavor.name }
// When no product flavors defined, use empty
if (!productFlavors) productFlavors.add('')
productFlavors.each { productFlavorName ->
buildTypes.each { buildTypeName ->