A tab completion script that works for Bash. Relies on the BSD md5
command on Mac and md5sum
on Linux, so as long as you have one of those two commands, this should work.
$ gradle [TAB]
#!/bin/bash | |
ktlint_version="0.40.0" | |
######################################################################## | |
# A wrapper for ktlint which automatically downloads and runs ktlint. | |
# ktlint executables will be installed under `build/ktlint`. | |
# | |
# Usage | |
# | |
# Download and run ktlint, passing arguments: |
#!/usr/bin/env bash | |
emulator=$ANDROID_HOME/tools/emulator | |
adb=$ANDROID_HOME/platform-tools/adb | |
EMULATOR_COUNT=$($emulator -list-avds | wc -l | cut -c 8) | |
RANDOM_INDEX=$(shuf -i 1-$EMULATOR_COUNT -n 1) | |
EMULATOR_NAME=$($emulator -list-avds | head -n $RANDOM_INDEX | tail -n 1) | |
printf "Starting $EMULATOR_NAME..." |
sealed class Optional<out T: Any> { | |
abstract val isPresent: Boolean | |
} | |
object None : Optional<Nothing>() { | |
override val isPresent: Boolean = false | |
} | |
data class Some<T: Any>(val value: T) : Optional<T>() { | |
override val isPresent: Boolean = true | |
} | |
fun <T: Any> T?.asOptional(): Optional<T> = this?.let(::Some) ?: None |
package com.dd.test; | |
import android.app.ActionBar; | |
import android.app.ActionBar.Tab; | |
import android.app.Activity; | |
import android.app.FragmentTransaction; | |
import android.content.Context; | |
import android.os.Bundle; | |
import android.os.Parcelable; | |
import android.support.annotation.StringRes; |
package be.digitalia.common.widgets; | |
import android.annotation.SuppressLint; | |
import android.annotation.TargetApi; | |
import android.content.Context; | |
import android.graphics.Rect; | |
import android.os.Build; | |
import android.support.v4.util.ObjectsCompat; | |
import android.util.AttributeSet; | |
import android.view.View; |
/* | |
* Copyright 2014 Chris Banes | |
* | |
* 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 |
import java.util.*; | |
import java.util.function.*; | |
import java.util.stream.*; | |
import static java.util.stream.Collectors.*; | |
import static java.util.Comparator.*; | |
/** | |
* http://stackoverflow.com/questions/22845574/how-to-dynamically-do-filtering-in-java-8 | |
* |
Moved to | |
https://github.com/romannurik/android-swipetodismiss |
As configured in my dotfiles.
start new:
tmux
start new with session name: