Skip to content

Instantly share code, notes, and snippets.

View huuphuoc1396's full-sized avatar
🤪

Phuoc Bui huuphuoc1396

🤪
View GitHub Profile
@huuphuoc1396
huuphuoc1396 / MainActivity.kt.kt
Last active October 19, 2020 07:50
Get all displays
val displays = displayManager.displays
@huuphuoc1396
huuphuoc1396 / MainActivity.kt
Last active October 19, 2020 07:50
Get DisplayManager
val displayManager = getSystemService(Context.DISPLAY_SERVICE) as DisplayManager
@huuphuoc1396
huuphuoc1396 / Manifest.xml
Last active October 19, 2020 07:51
Secondary activity in the manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.multiplescreens">
<application
<!-- See about the taskAffinity attribute at http://bit.ly/34RKvzC -->
<activity
android:name=".SecondActivity"
android:launchMode="singleTask"
android:taskAffinity="cover.container" />
</application>
</manifest>
@huuphuoc1396
huuphuoc1396 / permission-denied-github-ssh.sh
Last active October 19, 2020 07:52
Github - Permission denied (publickey) - Using ssh
ssh-add ~/.ssh/your_id_rsa
ssh-add -l
ssh -Tv [email protected]
@huuphuoc1396
huuphuoc1396 / ImageLoaderWithCertificate.java
Last active July 17, 2018 15:34
Trust anchor for certification path not found when loading image from URL
package com.certpathvalidator;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
@huuphuoc1396
huuphuoc1396 / git-change-author-commit.sh
Last active July 17, 2018 15:17
Change the author (name or email) of a commit
git commit --amend --author "your_name <[email protected]>" --no-edit && git rebase --continue
git push origin master --force