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
| { | |
| "theme": "light", | |
| "autoUpdate": false, | |
| "snippet": { | |
| "expanded": true, | |
| "newSnippetPrivate": false, | |
| "sorting": "updated_at", | |
| "sortingReverse": true | |
| }, | |
| "editor" : { |
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
| class SingleLiveEvent<T> : MutableLiveData<T>() { | |
| private val observers = CopyOnWriteArraySet<ObserverWrapper<T>>() | |
| @MainThread | |
| override fun observe(owner: LifecycleOwner, observer: Observer<T>) { | |
| val wrapper = ObserverWrapper(observer) | |
| observers.add(wrapper) | |
| super.observe(owner, wrapper) | |
| } |
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
| import androidx.lifecycle.LiveData | |
| import androidx.lifecycle.MediatorLiveData | |
| import kotlinx.coroutines.CoroutineScope | |
| import kotlinx.coroutines.Job | |
| import kotlinx.coroutines.delay | |
| import kotlinx.coroutines.launch | |
| fun <T> LiveData<T>.debounce(duration: Long = 1000L, coroutineScope: CoroutineScope) = MediatorLiveData<T>().also { mld -> | |
| val source = this |
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
| [Unit] | |
| Description=Docker Application Container Engine | |
| Documentation=https://docs.docker.com | |
| After=network-online.target docker.socket firewalld.service containerd.service time-set.target | |
| Wants=network-online.target containerd.service | |
| Requires=docker.socket | |
| [Service] | |
| Type=notify | |
| # the default is not to use systemd for cgroups because the delegate issues still |
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
| fun RepositoryHandler.enableMirror() { | |
| all { | |
| if (this is MavenArtifactRepository) { | |
| val originalUrl = this.url.toString().removeSuffix("/") | |
| urlMappings[originalUrl]?.let { | |
| logger.lifecycle("Repository[$url] is mirrored to $it") | |
| this.setUrl(it) | |
| } | |
| } | |
| } |
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
| curl --location 'https://api.openai.com/v1/chat/completions' \ | |
| --header 'Content-Type: application/json' \ | |
| -u :$OPENAI_API_KEY \ | |
| --data '{ | |
| "messages": [ | |
| { | |
| "role": "system", | |
| "content": "The current date and time is 2023-07-22T13:57:34+02:00. Be very presumptive when guessing the values of function parameters." | |
| }, | |
| { |
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
| import android.util.Log | |
| import io.ktor.util.decodeBase64Bytes | |
| import io.ktor.util.encodeBase64 | |
| import okhttp3.OkHttpClient | |
| import okhttp3.Request | |
| import okhttp3.Response | |
| import okhttp3.WebSocket | |
| import okhttp3.WebSocketListener | |
| import okio.ByteString | |
| import org.json.JSONArray |
OlderNewer