Skip to content

Instantly share code, notes, and snippets.

@mapyo
mapyo / hoge.kt
Created Apr 19, 2018
seald class sample
View hoge.kt
package jp.co.hoge
import org.junit.Test
sealed class Event {
class Loading : Event()
class Loaded(val result: String) : Event()
class LoadFailed(val reason: String) : Event()
}
@mapyo
mapyo / penguin.java
Last active Dec 6, 2017
class Penguin(java)をデコンパイルしたもの
View penguin.java
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) ansi
package com.mapyo.kotlindataclassproguardsample;
public class c
{
@mapyo
mapyo / dog.java
Created Dec 6, 2017
class Dogをデコンパイルしたもの
View dog.java
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) ansi
package com.mapyo.kotlindataclassproguardsample;
import a.a.a.a;
public final class b
{
@mapyo
mapyo / cat.java
Created Dec 6, 2017
data class Cat をデコンパイルしたもの
View cat.java
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) ansi
package com.mapyo.kotlindataclassproguardsample;
public final class a
{
@mapyo
mapyo / commit_version_name_stage_bump.rb
Created Jul 18, 2017
versionNameを指定したstage名で更新していくactionです
View commit_version_name_stage_bump.rb
module Fastlane
module Actions
class CommitVersionNameStageBumpAction < Action
PATH = 'app/build.gradle'
def self.run(params)
UI.message "Stage Name: #{params[:stage_name]}"
stage_name = params[:stage_name]
View kotlin_data_class_SerializedName.kt
public final class b
{
public final int a()
{
return a;
}
public final String b()
{
View DetailedImageActivity.java
public class DetailedImageActivity extends AppCompatActivity {
static final String IMAGE_URL = "imageUrl";
public static void launchActivity(Context context, String imageUrl) {
Intent intent = new Intent(context, ImageDetailActivity.class);
intent.putExtra(IMAGE_URL, imageUrl);
context.startActivity(intent);
}
@mapyo
mapyo / gist:323c4c62be27ede513d4
Last active Aug 4, 2016
Androidの実機でいい感じでキャプチャを取れるようにする方法のメモ
View gist:323c4c62be27ede513d4

1. AndroidStudio入れる

http://developer.android.com/intl/ja/sdk/index.html

※SDKがどうやって入るのか確認

2. adbコマンドのパスと環境変数の設定

※パス的なものはどこに入ってるのか見て調整する必要があります

echo 'export PATH="$PATH:$HOME/Library/Android/sdk/platform-tools"' >> ~/.bash_profile
echo 'export ANDROID_SDK_HOME="$HOME/Library/Android/sdk"' >> ~/.bash_profile
View ImageViewCustomAssersion.java
public static class ImageViewAssert extends AbstractAssert<ImageViewAssert, ImageView> {
public ImageViewAssert(ImageView actual) {
super(actual, ImageViewAssert.class);
}
public static ImageViewAssert assertThat(ImageView actual) {
return new ImageViewAssert(actual);
}
public ImageViewAssert hasDrawable(Drawable drawable) {
@mapyo
mapyo / git-checkout-this-pr
Last active Nov 14, 2016
現在の開いているプルリクのブランチに切り替えて変更分をとってくるやつ
View git-checkout-this-pr
#!/bin/sh
set -e
chrome-cli execute '(function () {
return [
location.hostname,
location.pathname.split("/")[1],
location.pathname.split("/")[2],
document.title,