Author: Michael Zeng
This file contains 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/env bash | |
# I've found that the "Migrate to AndroidX" converter in Android Studio doesn't work very | |
# well, so I wrote my own script to do the simple job of converting package names. | |
# | |
# You can download a CSV of package names here: https://developer.android.com/topic/libraries/support-library/downloads/androidx-class-mapping.csv | |
# | |
# It'll run faster on a clean build because then there are fewer files to scan over. | |
# | |
# Uses `gsed` because I'm on a Mac. Can easily replace with `sed` if you don't have `gsed`. |
This file contains 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
@ContextDsl | |
fun Route.coGet(path: String, block: suspend ApplicationCall.() -> ServerResponse): Route = get("/") { | |
val result = call.block() | |
when (result) { | |
is ServerResponse.Empty -> | |
call.respondText { "" } | |
is ServerResponse.Json -> | |
call.respondText(result.jsonString, ContentType.Application.Json) |
This file contains 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
fun Route.coHandler(controller: suspend RoutingContext.() -> ServerResponse): Route = | |
handler { | |
launch(it.vertx().dispatcher()) { | |
val response = it.controller() | |
when (response) { | |
is ServerResponse.Empty -> | |
it.response().end() | |
is ServerResponse.Json -> |
This file contains 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
import React from 'react' | |
import PropTypes from 'prop-types' | |
import { Formik } from 'formik' | |
import Dialog, { | |
DialogActions, | |
DialogContent, | |
DialogContentText, | |
DialogTitle | |
} from 'material-ui/Dialog' | |
import Button from 'material-ui/Button' |
This file contains 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 com.yourapp.test; | |
// import statements... | |
public class FlakyTests { | |
@Rule | |
RetryTestRule retry = new RetryTestRule(3); // will attempt each test up to 3 times | |
@Test |
This file contains 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
// Disable VirtualBox authentication | |
VBoxManage setproperty websrvauthlibrary null | |
// Start SOAP service so REX-Ray can talk to VirtualBox from the container host VMs | |
/Applications/VirtualBox.app/Contents/MacOS/vboxwebsrv -H 0.0.0.0 -v | |
// Create a Swarm cluster | |
docker-machine create --driver=virtualbox default | |
eval $(docker-machine env default) | |
TOKEN=$(docker run --rm swarm create) |
This file contains 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
import com.crashlytics.android.answers.Answers; | |
import com.crashlytics.android.answers.CustomEvent; | |
import com.squareup.okhttp.Interceptor; | |
import com.squareup.okhttp.MediaType; | |
import com.squareup.okhttp.Request; | |
import com.squareup.okhttp.RequestBody; | |
import com.squareup.okhttp.Response; | |
import com.squareup.okhttp.ResponseBody; | |
import java.io.IOException; |
This file contains 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
/* | |
* Copyright (C) 2016 Jeff Gilfelt. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains 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 me.angrybyte.coloringdemo; | |
/** | |
* IMPORTANT NOTICE | |
* | |
* This is now a part of SillyAndroid https://github.com/milosmns/silly-android, | |
* with new fixes and improvements. | |
*/ |