This file contains hidden or 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
| die() { | |
| echo "$*" >&2 | |
| exit 1 | |
| } | |
| warn() { | |
| echo "$*" >&2 | |
| } | |
| if [[ ! -d ".git/hooks" ]]; then |
This file contains hidden or 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 | |
| set -eux | |
| mkdir -p tmp || : | |
| cd tmp | |
| : "${size:=240}" | |
| : "${img_size:=$size}" |
This file contains hidden or 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
| maven { url "https://android.bintray.com/android-tools/" } | |
| maven { url "https://android.bintray.com/android-utils/" } | |
| maven { url "https://android.bintray.com/android-support/" } | |
| maven { url "https://android.bintray.com/android-jack/" } | |
| maven { url "https://firebase.bintray.com/gradle/" } | |
| maven { url "https://firebase.bintray.com/geofire/" } | |
| maven { url "https://firebase.bintray.com/firebase-jobdispatcher/" } | |
| maven { url "https://firebase.bintray.com/digits-migration-helper-android/" } | |
| maven { url "https://firebase.bintray.com/maven/" } | |
| maven { url "https://google.bintray.com/interactivemedia/" } |
This file contains hidden or 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 | |
| set -eu | |
| set -o pipefail | |
| filter_files() { | |
| local -r ref_name="$1" | |
| # select files by TAB | |
| git --no-pager diff --diff-filter=ACMU --name-only "$ref_name" | fzf -m | |
| } |
This file contains hidden or 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 android.app.Application | |
| import android.os.Bundle | |
| import android.view.View | |
| import android.widget.TextView | |
| import androidx.appcompat.app.AppCompatActivity | |
| import androidx.lifecycle.LiveData | |
| import androidx.lifecycle.MutableLiveData | |
| import androidx.lifecycle.Observer | |
| import androidx.lifecycle.ViewModelProviders |
This file contains hidden or 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
| class MyDefaultFactory extends ViewModelProviders.DefaultFactory { | |
| // constructor | |
| private final Map<String, ViewModel> mMap = new HashMap<>(); | |
| @Nullable | |
| private String onetimeCacheKey; | |
| @MainThread | |
| public void setKey(@NonNull String key) { |
This file contains hidden or 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
| def loadProperties(filename, properties) { | |
| file("$rootDir/$filename").withInputStream { | |
| properties.load(it) | |
| } | |
| } | |
| ext.properties = new Properties() | |
| loadProperties("version.properties", ext.properties) | |
| # properties.hogehoge |
This file contains hidden or 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 | |
| set -eu | |
| main() { | |
| local -r workspace="____movie2gif" | |
| local -r movie_filename="$1" | |
| local -r ratio="$2%" | |
| local -r frameRate="$3" | |
| local -r output_filename="${movie_filename%.*}.gif" |
This file contains hidden or 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.kgmshin.lint; | |
| import com.android.tools.lint.client.api.IssueRegistry; | |
| import com.android.tools.lint.detector.api.Issue; | |
| import java.util.Collections; | |
| import java.util.List; | |
| public class LintIssueRegistry extends IssueRegistry { |
This file contains hidden or 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 android.support.v7.preference.Preference | |
| import android.graphics.Bitmap | |
| import android.graphics.drawable.BitmapDrawable | |
| import android.graphics.drawable.Drawable | |
| import com.squareup.picasso.Target | |
| import java.lang.ref.WeakReference | |
| private class PreferenceTarget(pref: Preference) : Target { | |
| private val ref: WeakReference<Preference?> = WeakReference(pref) |