Skip to content

Instantly share code, notes, and snippets.

View mataku's full-sized avatar
🍊
one of NICOLE FUJITA fans

Takuma Homma mataku

🍊
one of NICOLE FUJITA fans
View GitHub Profile
dependencies {
// 有能なアノテーションが使える
compile 'com.android.support:support-annotations:22.2.0'
// テストのみで使用
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
}
@mataku
mataku / pic
Created November 26, 2017 11:55
pic
import okhttp3.Interceptor
import okhttp3.Response
class CustomInterceptor : Interceptor {
override fun intercept(chain: Interceptor.Chain): Response {
val url = chain.request().url().newBuilder()
.addQueryParameter("client_id", "some_id")
.addQueryParameter("client_secret", "some_key")
.build()
val request = chain.request().newBuilder()
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<android.support.constraint.ConstraintLayout
android:id="@+id/main_container"
android:layout_width="match_parent"
android:layout_height="match_parent" >
package net.rhythnn.droidsunset
import android.app.Activity
import android.support.test.runner.AndroidJUnit4
import android.support.test.rule.ActivityTestRule
import android.support.test.espresso.Espresso.onView
import android.support.test.espresso.Espresso.onData
import android.support.test.espresso.action.ViewActions.click
import android.support.test.espresso.matcher.ViewMatchers.*
import android.support.test.espresso.assertion.ViewAssertions.matches
android_permissions_checker.check(
apk: '/path/to/apk',
permission_list_file: '/path/to/generated_permission_list'
)
import android.arch.lifecycle.ViewModel
import com.mataku.scrobscrob.app.model.entity.Artist
import com.mataku.scrobscrob.app.model.entity.Album
class MusicContentViewModel : ViewModel() {
var artists = mutableListOf<Artist>()
var albums = mutableListOf<Album>()
}

基本

docker info    # イメージやコンテナ, ユーザ情報などの表示

コンテナの起動

docker run [OPTIONS] IMAGE_NAME:TAG [COMMAND] [ARGUMENTS]

# e.g. my_alpine というホスト名で alpine:3.8 を起動し, sh のプロセスを立ち上げる
import okhttp3.OkHttpClient
import retrofit2.Retrofit
class ApiClient {
companion object {
fun <T> create(service: Class<T>): T {
val client = OkHttpClient.Builder()
.addInterceptor(CustomInterceptor())
.build()
@mataku
mataku / build.gradle
Last active February 17, 2019 14:42
medium で使う
buildTypes {
test-a {
buildConfigField "String", "HOST", "\"test-a.mataku.com\""
debuggable true
applicationIdSuffix '.dev'
}
test-b {
buildConfigField "String", "HOST", "\"test-b.mataku.com\""
debuggable true