Skip to content

Instantly share code, notes, and snippets.

View luongvo's full-sized avatar
🚀
flying in the sky

Luong Vo (Lucas) luongvo

🚀
flying in the sky
View GitHub Profile
@luongvo
luongvo / manage_milestones_with_gh.md
Created November 23, 2023 02:08 — forked from doi-t/manage_milestones_with_gh.md
Manage milestones with gh

Use gh v0.11.0 or later for the "shell" aliases.

Run the following gh alias set commands for each operation. You can confirm the created aliases with gh alias list.

gh listMilestones

gh alias set listMilestones "api graphql -F owner=':owner' -F name=':repo' -f query='
    query ListMilestones(\$name: String\!, \$owner: String\!) {
        repository(owner: \$owner, name: \$name) {
            milestones(first: 100) {
@luongvo
luongvo / FullscreenPopup.kt
Created March 15, 2023 04:33
FullscreenPopup
package eu.wewox.modalsheet
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.content.ContextWrapper
import android.view.KeyEvent
import android.view.View
import android.view.ViewGroup
import androidx.compose.foundation.layout.Box
@luongvo
luongvo / RtlModalDrawer.kt
Created January 2, 2023 18:04
Jetpack Compose ModalDrawer from right/end side https://issuetracker.google.com/issues/174514369#comment18
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.material.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.LayoutDirection
private static boolean isAndroidModule(Project project) {
boolean isAndroidLibrary = project.plugins.hasPlugin('com.android.library')
boolean isAndroidApp = project.plugins.hasPlugin('com.android.application')
return isAndroidLibrary || isAndroidApp
}
afterEvaluate { project ->
def projectName = project.name
if (isAndroidModule(project)) setupAndroidReporting()
else setupKotlinReporting()
@luongvo
luongvo / convert-mov-to-mp4.md
Created December 27, 2021 18:25 — forked from rudyhuynh/convert-mov-to-mp4.md
Convert MOV to MP4
brew install ffmpeg
ffmpeg -i my-video.mov -vcodec h264 -acodec mp2 my-video.mp4
@luongvo
luongvo / flutter_github_ci.yml
Created September 8, 2021 16:21 — forked from rodydavis/flutter_github_ci.yml
Flutter Github Actions Build and Deploy Web to Firebase Hosting, iOS to Testflight, Android to Google Play (fastlane)
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build_web:
@luongvo
luongvo / ssl_pinning.sh
Last active January 10, 2023 11:34
SSL Pinning - Public key getting script
#!/bin/bash
certs=`openssl s_client -servername $1 -host $1 -port 443 -showcerts </dev/null 2>/dev/null | sed -n '/Certificate chain/,/Server certificate/p'`
rest=$certs
while [[ "$rest" =~ '-----BEGIN CERTIFICATE-----' ]]
do
cert="${rest%%-----END CERTIFICATE-----*}-----END CERTIFICATE-----"
rest=${rest#*-----END CERTIFICATE-----}
echo `echo "$cert" | grep 's:' | sed 's/.*s:\(.*\)/\1/'`
echo "$cert" | openssl x509 -pubkey -noout |
openssl rsa -pubin -outform der 2>/dev/null |
@luongvo
luongvo / ActivityLifecycle.md
Created December 7, 2018 07:12 — forked from kristopherjohnson/ActivityLifecycle.md
Notes about Android Activity lifecycle method ordering

Results of some experiments to determine which Activity lifecycle methods get called in certain situations.

Scenario: Launch app from home, then return home

Launch:

  • activity.onCreate()
  • activity.onStart()
  • activity.onResume()
  • activity.onWindowFocusChanged(true)
@luongvo
luongvo / config.yml
Created September 10, 2018 17:39 — forked from bassaer/config.yml
CircleCI 2.0でAndroidライブラリの自動デプロイ ref: http://qiita.com/bassaer/items/6b9aedae4571d59f0fdf
version: 2
jobs:
build:
branches:
only:
- master
- develop
docker:
# specify the version you desire here
- image: circleci/android:api-26-alpha
@luongvo
luongvo / Readme.md
Created May 28, 2018 20:06 — forked from gabrielemariotti/Readme.md
A SimpleSectionedRecyclerViewAdapter: use this class to realize a simple sectioned `RecyclerView.Adapter`.

You can use this class to realize a simple sectioned RecyclerView.Adapter without changing your code.

The RecyclerView should use a LinearLayoutManager. You can use this code also with the TwoWayView with the ListLayoutManager (https://github.com/lucasr/twoway-view)

This is a porting of the class SimpleSectionedListAdapter provided by Google

Screen

Example: