Skip to content

Instantly share code, notes, and snippets.

@thanhzusu
thanhzusu / get-hash-key-for-facebook-app.txt
Last active September 11, 2017 08:22
Android - Get hash key for Facebook app
General command:
keytool -exportcert -alias [your-key-alias] -keystore [/path/to/your/file.keystore] | openssl sha1 -binary | openssl base64
Example:
On OS X, run:
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64
On Windows, run:
keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | openssl sha1 -binary | openssl
base64
@thanhzusu
thanhzusu / react-native-common-cli.txt
Created September 11, 2017 07:06
React Native common CLI
- iOS IPA:
- bundle: react-native bundle --entry-file index.ios.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios
- archive: run achive under Product menu of Xcode
- Android APK:
- bundle: react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
- signed APK files:
- cd android && ./gradlew assembleRelease && cd ..
- cd android && ./gradlew assembleReleaseStaging && cd ..
@thanhzusu
thanhzusu / CodePush-release-CLI.txt
Created September 11, 2017 07:07
CodePush release CLI
- CodePush release CLI:
1. code-push release-react <appName> <platform>
2. [--bundleName <bundleName>]
3. [--deploymentName <deploymentName>]
4. [--description <description>]
5. [--development <development>]
6. [--disabled <disabled>]
7. [--entryFile <entryFile>]
8. [--gradleFile <gradleFile>]
9. [--mandatory]
@thanhzusu
thanhzusu / git-fork-repo.txt
Created September 11, 2017 07:09
Some git command for a fork repository
- Fork add upstream:
- git remote add upstream [url]
- Fork sync:
- git fetch upstream
- git checkout master
- git merge upstream/master
@thanhzusu
thanhzusu / config-git-with-case-sensitive.txt
Created October 4, 2017 05:04
Config git with case sensitive
git config core.ignorecase false
@thanhzusu
thanhzusu / generate-ssh-key-for-bitbucket.txt
Created October 30, 2017 06:43
Generate ssh key for bitbucket
1. Generate ssh key: ssh-keygen -t rsa -C "your_email@example.com"
2. Go to ssh folder: cd ~/.ssh/
3. Copy content of id_rsa.pub file
4. Go to bitbucket setting by going to your profile > select Bitbucket settings. Then select SSH keys and add new one.
@thanhzusu
thanhzusu / Terminating a process on port 8081.txt
Created November 14, 2017 03:38
Terminating a process on port 8081
Terminating a process on port 8081
Run the following command on a Mac to find the id for the process that is listening on port 8081:
$ sudo lsof -i :8081
Then run the following to terminate the process:
$ kill -9 <PID>
On Windows you can find the process using port 8081 using Resource Monitor and stop it using Task Manager.
@thanhzusu
thanhzusu / create-pem-file-from-p12-file.txt
Created November 30, 2017 05:48
Create PEM file from p12 file
Create PEM file from p12 file.
openssl pkcs12 -in pushcert.p12 -out pushcert.pem -nodes -clcerts
@thanhzusu
thanhzusu / screen-shot-by-xcrun-command-line.txt
Last active November 13, 2023 14:55
Take a screenshot or video by Xcode command-line
For Xcode 8.2 or later
You can take videos and screenshots of Simulator using the xcrun Xcode command-line utility.
1. Run your app on the simulator.
2. Open Terminal.app
3. Run the command
- To take a screenshot, xcrun simctl io booted screenshot
- To take a video, xcrun simctl io booted recordVideo <filename>.<file extension>.
For example: xcrun simctl io booted recordVideo appvideo.mov