Skip to content

Instantly share code, notes, and snippets.

View trantronghien's full-sized avatar

Trần Trọng Hiến (Blue Developer) trantronghien

View GitHub Profile
@trantronghien
trantronghien / reduce.js
Last active November 20, 2022 07:53
reduce function
let array = [4, 5, 6]
let initialValue = 1 // giá trị bắt đầu
let rs = array.reduce((previousValue, item, index, arrayReduce) => {
// console.log(item); // giá trị của item tại index, item = array[index]
// console.log(previousValue); // đầu tiên previousValue = initialValue, previousValue = return callbackReduce()
// console.log(index); // index của array
// console.log(arrayReduce); // arrayReduce == array
let result = previousValue + item
return result
@trantronghien
trantronghien / gist:604384f6d0a67e65663d27fdeb1db8f6
Created August 1, 2021 09:09
Fix Webstorm Remote Debugging do not work?
+ shutting down the IDE and then removing both
`~\AppData\Roaming\JetBrains\WebStorm2020.2\options\web-browsers.xml` and `~\AppData\Roaming\JetBrains\WebStorm2020.2\options\other.xml`
@trantronghien
trantronghien / md
Last active October 18, 2019 02:51
How do I get an apk file from an Android device?
step 1: Connect Android device to pc
step 2: find package installed on device
+ adb shell pm list packages -f -3
show list package for example:
+ package:/data/app/com.facebook.lite-8_89meYFwfdQ23e_DesbnA==/base.apk=com.facebook.lite
step 3: go to adb shell and pull apk file to sdcard
+ adb shell
+ cp /data/app/com.facebook.lite-8_89meYFwfdQ23e_DesbnA==/base.apk /sdcard/facebook.apk
step 4: pull apk file to pc
+ adb pull /sdcard/facebook.apk <path_pc_pull_file>
@trantronghien
trantronghien / md
Last active October 18, 2019 02:40
Decoding and Building apk
bước 1: Decoding
bước 2: Edit
bước 3: Building
bước 4: Sign App with keytool
b1:
apktool d <apk_file>.apk -o <dir_name>
b2:
edit
b3: