Automatically post emails that match the specified label to Slack.
Ref: https://gist.github.com/jamesramsay/9298cf3f4ac584a3dc05
- Create a new Google Apps Script at https://script.google.com
- Overwrite the placeholder with the javascript below
| /** | |
| * Set the adapter and call [clearReference] extension function in one call. | |
| * Use this extension if the current Fragment is going to be REPLACED. (When using fragmentTransaction.add is not necessary) the back stack. | |
| */ | |
| fun <VH : RecyclerView.ViewHolder> RecyclerView.setNullableAdapter( | |
| adapter: RecyclerView.Adapter<VH> | |
| ) { | |
| this.adapter = adapter | |
| this.clearReference() |
| import android.view.LayoutInflater | |
| import android.view.View | |
| import android.view.ViewGroup | |
| import androidx.appcompat.app.AppCompatActivity | |
| import androidx.fragment.app.DialogFragment | |
| import androidx.fragment.app.Fragment | |
| import androidx.lifecycle.DefaultLifecycleObserver | |
| import androidx.lifecycle.Lifecycle | |
| import androidx.lifecycle.LifecycleOwner | |
| import androidx.viewbinding.ViewBinding |
| let excludedActivityTypes = [ | |
| UIActivity.ActivityType.print, | |
| UIActivity.ActivityType.openInIBooks, | |
| UIActivity.ActivityType.copyToPasteboard, | |
| UIActivity.ActivityType.addToReadingList, | |
| UIActivity.ActivityType.assignToContact, | |
| UIActivity.ActivityType.copyToPasteboard, | |
| UIActivity.ActivityType.mail, | |
| UIActivity.ActivityType.markupAsPDF, | |
| UIActivity.ActivityType.postToFacebook, |
| data class Resource<out T>( | |
| val status: Status, | |
| val data: T?, | |
| val message:String? | |
| ){ | |
| companion object{ | |
| fun <T> success(data:T?): Resource<T>{ | |
| return Resource(Status.SUCCESS, data, null) | |
| } |
| BindingScoped.kt | |
| @Scope | |
| @Retention(AnnotationRetention.BINARY) | |
| annotation class BindingScoped | |
| ------------------------------------------------------- | |
| CustomBindingComponent.kt |
| import Foundation | |
| import Combine | |
| import SwiftUI | |
| import UIKit | |
| struct GridView: View { | |
| @ObservedObject | |
| var vm = GridViewModel() | |
| let rows: Int = 25 |
| // | |
| // MockURLProtocol.swift | |
| // Cheeta | |
| // | |
| // Created by Mahabaleshwar on 14/04/20. | |
| // Copyright © 2020 TW. All rights reserved. | |
| // | |
| import Foundation |
Automatically post emails that match the specified label to Slack.
Ref: https://gist.github.com/jamesramsay/9298cf3f4ac584a3dc05
| // https://github.com/Zhuinden/fragmentviewbindingdelegate-kt | |
| import android.view.View | |
| import androidx.fragment.app.Fragment | |
| import androidx.lifecycle.DefaultLifecycleObserver | |
| import androidx.lifecycle.Lifecycle | |
| import androidx.lifecycle.LifecycleOwner | |
| import androidx.lifecycle.Observer | |
| import androidx.viewbinding.ViewBinding | |
| import kotlin.properties.ReadOnlyProperty |
| object MoshiAdapters { | |
| val moshi : Moshi = Moshi.Builder().build() | |
| inline fun <reified T: Any> moshiAdapter(clazz: Class<T> = T::class.java): Lazy<JsonAdapter<T>> | |
| = lazy { moshi.adapter(clazz) } | |
| val movie: JsonAdapter<Movie> by moshiAdapter() | |
| val user: JsonAdapter<User> by moshiAdapter() |