https://codedaily.io/courses/Master-React-Native-Animations/AnimatedValue-Functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** @typedef {{x: Number, y: Number, w: Number, h: Number}} AndroidLayout */ | |
| /** | |
| * @param {AndroidLayout} layout | |
| * @param {Number} rotateRadian | |
| * @param {Number} scale | |
| * @returns {AndroidLayout} | |
| */ | |
| const androidMeasureFix = (layout, rotateRadian, scale) => { | |
| const _layout = { |
Emulator 30.7.4 crash when start Solution: downgrade to 30.7.2
Download Android Emulator v30.7.2 for macosx OS.zip https://dl.google.com/android/repository/emulator-darwin_x64-7395805.zip
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * parse string as lat long | |
| * copyright https://gist.github.com/0x0a0d | |
| * typical: '10.777399,,,,106.687621' | |
| * @param {string} query - user input | |
| * @param {boolean} [parseNumber=true] - return number instead of string type | |
| * @return {null|{lat: string, lng: string}|{lat: number, lng: number}} | |
| */ | |
| const parseLatLng = function(query, parseNumber = true) { | |
| if (typeof query !== 'string') return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RCT_METRO_PORT=9081 yarn android --port 9081 | |
| RCT_METRO_PORT=9081 npm run android --port 9081 | |
| RCT_METRO_PORT=9081 react-native run-android --port 9081 | |
| # Advance | |
| PORT=9081; RCT_METRO_PORT=$PORT yarn android --port $PORT | |
| # change android to ios if dev on iOS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # install docker | |
| if [[ ! `which docker` ]] | |
| then | |
| apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
| sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
| $(lsb_release -cs) \ | |
| stable" | |
| apt update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #https://askubuntu.com/questions/259739/kswapd0-is-taking-a-lot-of-cpu | |
| echo 1 | sudo tee /proc/sys/vm/drop_caches | |
| # ssh port | |
| rand_port=0 | |
| while [[ $rand_port -lt 10000 ]] | |
| do | |
| rand_port=$(($RANDOM * 2)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "0": { | |
| "en": "Transaction is successful", | |
| "vi": "Giao dịch thành công" | |
| }, | |
| "1": { | |
| "en": "This transaction has been declined by issuer bank or card have been not registered online payment services. Please contact your bank for further clarification.", | |
| "vi": "Ngân hàng phát hành thẻ không cấp phép cho giao dịch hoặc thẻ chưa được kích hoạt dịch vụ thanh toán trên Internet. Vui lòng liên hệ ngân hàng theo số điện thoại sau mặt thẻ được hỗ trợ chi tiết." | |
| }, | |
| "2": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo "[+] Docker registry generator" | |
| read -p "[+] Domain: " DOMAIN | |
| read -p "[+] Data location: [$(pwd)] " DOCKER_REGISTRY_PATH | |
| read -p "[+] Docker name: [registry-test] " DOCKER_NAME | |
| read -p "[+] Docker listen port: [443] " DOCKER_PORT | |
| read -p "[+] Username: " USERNAME | |
| read -s -p "[+] Password: " PASSWORD | |
| if [[ "$DOCKER_REGISTRY_PATH" == "" ]]; then DOCKER_REGISTRY_PATH=`pwd`; fi | |
| if [[ "$DOCKER_NAME" == "" ]]; then DOCKER_NAME='registry-test'; fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getSameLength(pages) { | |
| let j = 0; | |
| for (; j < pages[0].length; j++) { | |
| for (let i = 0; i < pages.length - 1; i++) { | |
| if (pages[i][j] !== pages[i + 1][j]) return j - 1 | |
| } | |
| } | |
| return j | |
| } |
