Skip to content

Instantly share code, notes, and snippets.

View roughike's full-sized avatar
🎯
awesome stuff

Iiro Krankka roughike

🎯
awesome stuff
View GitHub Profile
@roughike
roughike / multi_isolate_webserver.dart
Created February 10, 2020 08:11
A simple dart webserver that distributes multiple connections across 6 Isolates.
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();
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 August 8, 2016 08:19 — 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.
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 ->