Skip to content

Instantly share code, notes, and snippets.

@phannam1412
phannam1412 / gist:5cdc44f774d22cc9bd96d660793e4e19
Created September 25, 2017 02:43
React Native interview questions
Javascript:
- How does javascript scope works ?
- How does javascript hoisting works ?
- What are the es6 features ?
Misc:
# Git branch in prompt, copy and paste this to ~/.bash_profile
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
# Copy with progress
rsync -ah --progress source destination
Write it in Python, input from input.txt and output to output.txt
input.txt contains an integer representing the size of the matrix.
output.txt contains the result matrix.
Example input and output:
input.txt: 3
output.txt:
5 6 7
@phannam1412
phannam1412 / gist:141a09a31d81b2e1562f77268fe6e8c8
Created March 19, 2018 09:16
React Native - Auto build and upload apk to your server
#!/usr/bin/env bash
react-native bundle --dev false --platform android --entry-file index.android.js --bundle-output ./android/app/src/main/assets/index.android.bundle --assets-dest ./android/app/src/main/res/
cd android
./gradlew assembleDebug
cd ..
cp android/app/build/outputs/apk/debug/app-debug.apk app-debug.apk
# FTP upload file
HOST='your-host.com'