Skip to content
View kdbrian's full-sized avatar
:octocat:
:octocat:

Block or report kdbrian

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
kdbrian/README.md

Coding is hard

Pinned Loading

  1. Am having an error wrapper class ove... Am having an error wrapper class over the normal Exception interface, with this I can parse errors and handle them for a better response , for example the Socket timeout exception which is common in most network requests.
    1
    sealed class AppError(
    2
        override val message: String? = null
    3
    ) : Exception(){
    4
         data object SocketTimeOutError : AppError("Failed to connect, please check your internet connection and retry.") 
    5
    }
  2. An abstraction of spring security ... An abstraction of spring security methods to interact with the jwt, requires the libraries jjwt-api jjwt-impl jjwt-jackson The implementation is really similar but can be customized
    1
    public interface JwtService {
    2
    
                  
    3
        final String SECRET_KEY = "";
    4
    
                  
    5
    
                  
  3. A viewmodel factory, can be used to ... A viewmodel factory, can be used to provision a viewmodel from a kotlin application that has lifecycle.
    1
    @Suppress("UNCHECKED_CAST")
    2
    class MainViewModelFactory(val application: Application) : ViewModelProvider.Factory {
    3
        override fun <T : androidx.lifecycle.ViewModel> create(modelClass: Class<T>): T {
    4
            return MainViewModel(application) as T
    5
        }