Skip to content

Instantly share code, notes, and snippets.

@thanhzusu
thanhzusu / gist:783d5052798d842c092dd290b173ffa6
Created January 8, 2019 03:53
React native - Integrating Vscode to launch the editor when clicking on any stack frame to jump to the source file
When you see Red Box with stack trace, you can click any
stack frame to jump to the source file. The packager will launch your
editor of choice. It will first look at REACT_EDITOR environment
variable, then at EDITOR. To set it up, you can add something like
export REACT_EDITOR=atom to your ~/.bashrc or ~/.zshrc depending on
which shell you use.
VScode supports a command to isntall quickly:
> Shell Command: Install 'code' command in PATH command.
(https://code.visualstudio.com/docs/setup/mac)
@thanhzusu
thanhzusu / ffmpeg-mov-to-mp4
Created January 21, 2019 02:42
Convert .mov to mp4 by command line with ffmpeg
1. Install ffmpeg through Brew using brew install ffmpeg
2. Open termial and run:
ffmpeg -i /path/to/input/file /path/to/output.mp4
@thanhzusu
thanhzusu / app.js
Last active March 11, 2019 10:06
React native animation usage example
import React from 'react'
import {
View,
Animated,
FlatList,
} from 'react-native'
export default class App extends React.Component {
state = {
shouldShowStickyHeader: false,
@thanhzusu
thanhzusu / Add all known keys to the SSH agent
Created May 9, 2019 05:14
GitLab - Resolved the issue Permission denied (publickey) even you have already added SSH key
You have already added your SSH key to Gitlab account and it's working well but sometime when you join to new repository and it raised an error like below:
Permission denied (publickey).
You can fix this issue by Add all known keys to the SSH agent:
ssh-add -A
Now this works but it won’t persist across reboots. So if you want to never worry about this again, just open up your user’s ~/.bash_profile file like this:
@thanhzusu
thanhzusu / gist:48a36804599e62e6aba4213dfab64ca5
Created August 8, 2019 15:37
Custom font in react native app
https://blog.bam.tech/developper-news/add-a-custom-font-to-your-react-native-app
@thanhzusu
thanhzusu / Generate Android Assets
Created August 11, 2019 08:23
Generate Android Assets
https://romannurik.github.io/AndroidAssetStudio/
@thanhzusu
thanhzusu / react-native-webview-callback
Last active August 11, 2019 14:43
React native - Using onNavigationStateChange to mange callbacks from WebView to react native
In React Native context
render() {
return <WebView onNavigationStateChange={this.onNavigationStateChange} />
}
onNavigationStateChange = (e) => {
// allow normal the natvigation
let allowChanged = true;
@thanhzusu
thanhzusu / start-emulator-simulator-command
Created September 27, 2019 03:01
Start an Android emulator or iOS simulator by command line
Open terminal app:
alias android-avd="emulator -avd Nexus_5X_API_29_x86 &"
alias ios-simulator="open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/"
Then just run android-avd or ios-simulator
@thanhzusu
thanhzusu / shema.md
Created February 7, 2020 09:10
Download scheme graphql for Android apollo
@thanhzusu
thanhzusu / fixed-issue-push-notification-app-killed
Created February 20, 2020 08:01
Fixed issue receive push notification when app is killed
While developing your app, if sometime you don't see the push notification when the app is killed, you must close your app, then let's open again by tap on the app's icon on the Launcher.
Then close it by swipe off. You will see the magic.