Skip to content

Instantly share code, notes, and snippets.

View truongngoclinh's full-sized avatar
🎯
Focusing

Trương Ngọc Linh truongngoclinh

🎯
Focusing
  • Tokyo
View GitHub Profile
@truongngoclinh
truongngoclinh / work-with-multiple-github-accounts.md
Created June 5, 2023 12:14 — forked from rahularity/work-with-multiple-github-accounts.md
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@truongngoclinh
truongngoclinh / jacoco_app_kotlin.gradle
Last active April 20, 2021 11:19
Jacoco test coverage report for package, application level
apply plugin: 'jacoco'
android {
testOptions.unitTests.all {
jacoco {
includeNoLocationClasses = true
}
}
}
@truongngoclinh
truongngoclinh / GitlabGroupCloning.sh
Created July 24, 2019 12:32
Clone all projects in gitlab group
#!/usr/bin/env bash
BASE_PATH="your domain"
GITLAB_PRIVATE_TOKEN="your private token"
if [ -z "$1" ]
then
echo "group name is required."
exit 1;
private Bitmap generateReceiptBitmap(ArrayList<PrinterDatum> data) {
ReceiptViewAdapter adapter = new ReceiptViewAdapter();
RecyclerView rv = new RecyclerView(mActivity);
rv.setLayoutManager(new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false));
rv.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
rv.setAdapter(adapter);
adapter.setData(data);
return loadBitmapFromView(rv);
}
@truongngoclinh
truongngoclinh / TSLInt-Prettier-CreateReactApp-TypeScript-setup.md
Created May 3, 2019 05:29 — forked from rimatla/TSLInt-Prettier-CreateReactApp-TypeScript-setup.md
Create React App + TypeScript Linting with TSLint and Prettier setup for on VSCode

Ps: The current setup was done on 01-04-19

Project Dependency Versions at the time 👇

  "react": "^16.7.0",
  "react-dom": "^16.7.0",
  "react-scripts": "2.1.3",
  "typescript": "^3.2.2"
  "tslint": "^5.12.0",
  "tslint-config-prettier": "^1.17.0",
private fun <T> any(): T {
Mockito.any<T>()
return uninitialized()
}
private fun <T> uninitialized(): T = null as T
private fun <T> any(): T {
Mockito.any<T>()
return uninitialized()
}
private fun <T> uninitialized(): T = null as T
private fun <T> any(): T {
Mockito.any<T>()
return uninitialized()
}
private fun <T> uninitialized(): T = null as T
@truongngoclinh
truongngoclinh / UnsafeHttpClient.kt
Created December 18, 2018 05:22 — forked from maiconhellmann/UnsafeOkHttpClient.kt
UnsafeHttpClient wrote in Kotlin
import okhttp3.OkHttpClient
import java.security.cert.CertificateException
import javax.net.ssl.SSLContext
import javax.net.ssl.TrustManager
import javax.net.ssl.X509TrustManager
class UnsafeOkHttpClient {
companion object {
fun getUnsafeOkHttpClient(): OkHttpClient.Builder {
try {
@truongngoclinh
truongngoclinh / BaseActivity.java
Last active July 13, 2018 06:40
Android N + language problem
@Override
protected void attachBaseContext(Context newBase) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
super.attachBaseContext(wrap(newBase, new LocalState().getLocale().getLanguage()));
} else {
super.attachBaseContext(newBase);
}
}