Skip to content

Instantly share code, notes, and snippets.

View volo-droid's full-sized avatar
🐈
Слава Україні!

Volo volo-droid

🐈
Слава Україні!
View GitHub Profile
@volo-droid
volo-droid / listAdapter.kt
Created May 16, 2021 21:55
Creating RecyclerView list adapter without extra adapter/view holder classes
fun <T : Any, B : ViewBinding> createListAdapter(
bindingInflater: (LayoutInflater) -> B,
bindData: B.(T) -> Unit,
): ListAdapter<T, *> = BindingListAdapter(bindingInflater, bindData)
class BindableViewHolder<T : Any, B : ViewBinding>(
private val binding: B,
private val bindData: B.(T) -> Unit,
) : RecyclerView.ViewHolder(binding.root) {
#/bin/sh
#
# Run the file with sudo
#
launchctl unload /System/Library/LaunchDaemons/com.apple.blued.plist
kextunload -b com.apple.iokit.IOBluetoothSerialManager
kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
launchctl load /System/Library/LaunchDaemons/com.apple.blued.plist
kextload -b com.apple.iokit.IOBluetoothSerialManager
kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport