View movie2gif.sh
#!/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"
View LintIssureRegistory.java
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 {
View PreferenceTarget.kt
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)
View renew_PreferenceFragmentCompat.kt
class SettingFragment : PreferenceFragmentCompat() {
companion object {
fun newInstance(rootKey: String?): SettingFragment = SettingFragment().apply {
arguments = Bundle().apply {
putString(PreferenceFragmentCompat.ARG_PREFERENCE_ROOT, rootKey)
}
}
}
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
View BookmarkTranslator.md
object BookmarkTranslator {
  fun toPresentation(model: Bookmark): BookmarkViewModel {
    return BookmarkViewModel().build(model.id.value) {
      name = model.name
      // ommit
    }
  }

  fun toDomainId(viewModel: BookmarkViewModel): Bookmark.Id = Bookmark.Id(viewModel.id.key)
View atom.installed
atom-dark-ui-slim
autocomplete-paths
autocomplete-sass
color-picker
highlight-selected
jumpy
maximize-panes
merge-conflicts
minimap
minimap-autohide
View gist:10add47e76a48b1ecebe
http://chrisjenx.com/gradle-robolectric-jacoco-dagger/
View Failure__NoSetter.java
@Table
data class AuthorizedUser(
@Column
val ok: Boolean,
@Column
val url: String,
@Column
val team: String,
View ConvCommands.md

sbt

Output 'sbt test-only' with appropreate classes.

sbt_test_only () {
    [[ $# -eq 0 ]] && return 1
    local classes=$(git log --name-only --oneline $1..HEAD|grep "^test"|sort|uniq|while read line; do echo "$(head -1 $line|awk '$0=$2').$(cat $line|grep "object"|awk '$0=$2')"; done|xargs)  
    echo "sbt \"test-only $classes\""
}
View ReadWritePropertySample.kt
import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KProperty
class IntRestrictedProperty(minValue : Int, maxValue : Int, private var curValue:Int = 0) : ReadWriteProperty<Any?, Int> {
val valueRange = IntRange(minValue, maxValue)
override fun getValue(thisRef: Any?, prop: KProperty<*>): Int = curValue
override fun setValue(thisRef: Any?, prop: KProperty<*>, value: Int) {
curValue = valueRange.clamp(value)