Skip to content

Instantly share code, notes, and snippets.

View huutho-dev's full-sized avatar

huutho.dev huutho-dev

  • Freedom Inc.
  • HaNoi
View GitHub Profile
@huutho-dev
huutho-dev / multiple-keys-gitlab.md
Created June 2, 2023 16:07 — forked from dotspencer/multiple-keys-gitlab.md
Multiple Gitlab accounts with multiple ssh keys

Gitlab won't allow reuse of a public ssh key for multiple accounts. To get around this you need to create a second ssh key for the second account.

Create or modify your ~/.ssh/config file:

# normal                                                                                                                                                                  
Host gitlab.com-work_username
     HostName gitlab.com
     PreferredAuthentications publickey
 IdentityFile ~/.ssh/id_rsa
@huutho-dev
huutho-dev / 1 ViewBindingDelegates.kt
Created October 23, 2022 18:28 — forked from gmk57/1 ViewBindingDelegates.kt
Kotlin delegates for Android View Binding with usage examples
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
@huutho-dev
huutho-dev / BaseUpdateCheckActivity.kt
Created April 3, 2022 05:40 — forked from saikiran91/BaseUpdateCheckActivity.kt
Android officially announced the in-app updates. https://developer.android.com/guide/app-bundle/in-app-updates. This is the code sample for handling both IMMEDIATE and FLEXIBLE updates in a single activity; Kotlin way.
import android.app.Activity
import android.content.Intent
import android.content.IntentSender
import android.os.Bundle
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import com.google.android.material.snackbar.Snackbar
import com.google.android.play.core.appupdate.AppUpdateManager
import com.google.android.play.core.appupdate.AppUpdateManagerFactory
@huutho-dev
huutho-dev / JapaneseCharacter.java
Created January 21, 2019 08:12 — forked from mediavrog/JapaneseCharacter.java
Simple string conversion from Hiragana to Katakana and vice versa. Uses the JapaneseCharacter class from Duane J. May and combines it with a simple Utility class method to perform the actual conversion.
/**
* JapaneseCharacter contains static functions to do various tests
* on characters to determine if it is one of the various types of
* characters used in the japanese writing system.
* <p/>
* There are also a functions to translate between Katakana, Hiragana,
* and Romaji.
*
* @author Duane J. May <djmay@mayhoo.com>
* @version $Id: JapaneseCharacter.java,v 1.2 2002/04/20 18:10:24 djmay Exp $
@huutho-dev
huutho-dev / cloudSettings
Created October 11, 2018 14:08 — forked from phamquyhai/cloudSettings
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-05-25T03:20:10.584Z","extensionVersion":"v2.9.2"}
@huutho-dev
huutho-dev / README.md
Created September 28, 2018 02:46 — forked from gabrielemariotti/README.md
How to manage the support libraries in a multi-module projects. Thanks to Fernando Cejas (http://fernandocejas.com/)

Centralize the support libraries dependencies in gradle

Working with multi-modules project, it is very useful to centralize the dependencies, especially the support libraries.

A very good way is to separate gradle build files, defining something like:

root
  --gradleScript
 ----dependencies.gradle
@huutho-dev
huutho-dev / README.md
Created June 21, 2018 01:18 — forked from lopspower/README.md
All Android Directory Path

All Android Directory Path

Twitter

1) System directories

⚠️ We can't write to these folers

Method Result