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
#!/bin/bash | |
set -u | |
abort() { | |
printf "%s\n" "$@" | |
exit 1 | |
} | |
if [ -z "${BASH_VERSION:-}" ]; then | |
abort "Bash is required to interpret this script." |
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
#!/bin/bash | |
set -u | |
abort() { | |
printf "%s\n" "$@" | |
exit 1 | |
} | |
if [ -z "${BASH_VERSION:-}" ]; then | |
abort "Bash is required to interpret this script." |
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
@Suppress("UNCHECKED_CAST") | |
@BindingAdapter("itemsWithListAdapter") | |
fun <T, VH : RecyclerView.ViewHolder> setItemsWithListAdapter( | |
recyclerView: RecyclerView, | |
items: List<T>? | |
) { | |
(recyclerView.adapter as? ListAdapter<T, VH>)?.let { adapter -> | |
val newList = if (items == null || items.isEmpty()) null else ArrayList(items) | |
adapter.submitList(newList) | |
if (newList == null) { |
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
#!/bin/sh | |
# | |
# This script should be run via curl: | |
# sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
# or via wget: | |
# sh -c "$(wget -qO- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
# or via fetch: | |
# sh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
# | |
# As an alternative, you can first download the install script and run it afterwards: |
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
π Morning 73 commits βββββββββββββββββββββ 4.5% | |
π Daytime 644 commits βββββββββββββββββββββ 39.8% | |
π Evening 691 commits βββββββββββββββββββββ 42.7% | |
π Night 209 commits βββββββββββββββββββββ 12.9% |
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
inline fun <reified T : Fragment> FragmentManager.replaceFragment( | |
@IdRes containerViewId: Int, | |
vararg param: Pair<String, Any?>, | |
tag: String = T::class.java.simpleName | |
): T? { | |
return findFragment() ?: T::class.java.newInstance().also { newFragment -> | |
newFragment.arguments = bundleOf(*param) | |
beginTransaction() | |
.replace(containerViewId, newFragment, tag) | |
.commitAllowStateLoss() |
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
inline fun <reified T : AppCompatActivity> Context.startActivity( | |
vararg extras: Pair<String, Any?>, | |
intentAction: Intent.() -> Unit = {} | |
) { | |
startActivity(Intent(this, T::class.java).apply { | |
putExtras(bundleOf(*extras)) | |
intentAction() | |
}) | |
} |
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
@BindingAdapter("textResId") | |
fun TextView.setStringResId(@StringRes value: Int) { | |
if (value == 0) return | |
setText(value) | |
} | |
@BindingAdapter("textColorResId") | |
fun TextView.setTextColorResId(@ColorRes value: Int) { | |
if (value == 0) return | |
setTextColor(ContextCompat.getColor(context, value)) |
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
rm -Rf ~/Library/Preferences/AndroidStudio | |
rm -Rf ~/Library/Preferences/com.google.android | |
rm -Rf ~/Library/Preferences/com.android | |
rm -Rf ~/Library/Application/Support/AndroidStudio | |
rm -Rf ~/Library/Logs/AndroidStudio | |
rm -Rf ~/Library/Caches/AndroidStudio |
NewerOlder