Skip to content

Instantly share code, notes, and snippets.

Avatar

Cüneyt AYYILDIZ Swisyn

View GitHub Profile
@zhuowei
zhuowei / Ensemble.plist
Last active Nov 8, 2022
Put this file as /Library/Preferences/FeatureFlags/Domain/Ensemble.plist and reboot to (hopefully) turn on Universal Control on macOS 12
View Ensemble.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- not sure which one it is, so set both -->
<key>Ensemble</key>
<dict>
<key>Enabled</key>
<true/>
</dict>
View Android TopSheetDialog Implementation by Taskito.md
<style name="TopSheet_DialogAnimation">
  <item name="android:windowEnterAnimation">@anim/slide_out_from_top</item>
  <item name="android:windowExitAnimation">@anim/slide_back_to_top</item>
</style>

slide_out_from_top

@frankfka
frankfka / iOSActivityRingSwiftUI.swift
Created Apr 29, 2020
iOS Activity Ring in SwiftUI
View iOSActivityRingSwiftUI.swift
import SwiftUI
import PlaygroundSupport
extension Double {
func toRadians() -> Double {
return self * Double.pi / 180
}
func toCGFloat() -> CGFloat {
return CGFloat(self)
@osipxd
osipxd / tooling.md
Last active Mar 22, 2022
Tooling. Tips&Tricks - Notes
View tooling.md

Tooling. Tips&Tricks

Материалы к докладу на митап Redmadrobot 30 апреля.

Habr | YouTube | Презентация

Git

  • Merging vs. Rebasing - сравнение подходов с merge и rebase от Atlassian. У них вообще много хороших статей, очень советую.
  • Why you should stop using Git rebase - какие сложности могут возникнуть, если чрезмерно увлечься rebase.
  • Pro Git. Git Tools - Rewriting History - глава из книги Pro Git. Подробно описывается работа с interactive rebase. Про stash, patch, cherry-pick можно почитать там же.
@osipxd
osipxd / ViewBinding.kt
Last active May 20, 2020
View binding extensions + delegate
View ViewBinding.kt
/**
* Инфлейт ViewBinding заданного типа [T].
*
* В качестве родителя используется [ViewGroup], по умолчанию view прикрепляется к корню родителя.
* **ВАЖНО!** Для инфлейта вьюх с `merge` в корне нужно использовать только этот метод.
*/
inline fun <reified T : ViewBinding> ViewGroup.inflateViewBinding(
context: Context = this.context,
attachToRoot: Boolean = true
): T {
@osipxd
osipxd / ViewModelFactory.kt
Created Mar 27, 2020
Dagger ViewModel Multibinding
View ViewModelFactory.kt
class ViewModelFactory @Inject constructor(
private val providers: Map<Class<out ViewModel>, @JvmSuppressWildcards Provider<ViewModel>>
) : ViewModelProvider.Factory {
override fun <T : ViewModel> create(modelClass: Class<T>): T {
val provider = providers[modelClass]
?: providers.asIterable().find { modelClass.isAssignableFrom(it.key) }?.value
?: error("Unknown ViewModel class $modelClass")
return try {
View alert-function-builder.swift
import UIKit
struct Action {
let title: String
let style: UIAlertAction.Style
let action: () -> Void
}
extension Action {
static func `default`(_ title: String, action: @escaping () -> Void) -> [Action] {
@RBusarow
RBusarow / TestCoroutineExtension.kt
Last active Nov 9, 2022
A JUnit 4 Rule and JUnit 5 Extension for utilizing TestCoroutineDispatcher and TestCoroutineScope from kotlinx.coroutines-test
View TestCoroutineExtension.kt
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.test.TestCoroutineDispatcher
import kotlinx.coroutines.test.TestCoroutineScope
import kotlinx.coroutines.test.resetMain
import kotlinx.coroutines.test.setMain
import org.junit.jupiter.api.extension.AfterAllCallback
import org.junit.jupiter.api.extension.AfterEachCallback
import org.junit.jupiter.api.extension.BeforeAllCallback
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.api.extension.ExtensionContext
@mottet-dev
mottet-dev / main.py
Created Sep 11, 2018
InstagramBot - Full
View main.py
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
class InstagramBot():
def __init__(self, email, password):
self.browserProfile = webdriver.ChromeOptions()
self.browserProfile.add_experimental_option('prefs', {'intl.accept_languages': 'en,en_US'})
self.browser = webdriver.Chrome('chromedriver.exe', chrome_options=self.browserProfile)
self.email = email
@DaleLaw
DaleLaw / EventBus.kt
Last active May 4, 2022
Implement EventBus with Kotlin coroutine
View EventBus.kt
object EventBus {
val bus: BroadcastChannel<Any> = BroadcastChannel()
fun send(o: Any) {
launch {
bus.send(o)
}
}