Skip to content

Instantly share code, notes, and snippets.

View volo-droid's full-sized avatar
🇺🇦
Stand with Ukraine!

Volo volo-droid

🇺🇦
Stand with Ukraine!
View GitHub Profile
@volo-droid
volo-droid / FlatMappedStateFlow.kt
Last active April 4, 2025 10:14
An experimental implementation of the flatMapLatest operator for StateFlow
/*
* Copyright (c) 2025 Volodymyr Galandzij
*
* 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
@volo-droid
volo-droid / ToothpickViewModelDelegates.kt
Last active March 24, 2025 00:21
ViewModel delegates for Toothpick injection library
/*
* Copyright (c) 2025 Volodymyr Galandzij
*
* 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
@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