Skip to content

Instantly share code, notes, and snippets.

View hungdev's full-sized avatar
💭
I may be slow to respond.

Hung Vu hungdev

💭
I may be slow to respond.
View GitHub Profile
@hungdev
hungdev / alert React native
Created July 22, 2017 02:49
alert React native
Alert.alert(
'Qubikal',
'Delete Image?',
[
{ text: 'No', onPress: () => console.log('Cancel Pressed'), style: 'cancel' },
{
text: 'Yes',
onPress: () => {
api.setToken(this.props.user.token)
api.deleteImage(this.props.image._id).then(response => {
@hungdev
hungdev / SyncPath.js
Created November 4, 2017 04:15 — forked from davideast/SyncPath.js
Firebase Social Network Client Fanout
export class SyncPath {
constructor(rootRef, path) {
this._rootRef = rootRef;
this.user = this._rootRef.getAuth();
this._userDataRef = this._rootRef.child(path).child(this.user.uid);
this.data = {};
this._userDataRef.on('value', (snap) => this.data = snap.val() || {});
}
keys() {
return Object.keys(this.data);
@hungdev
hungdev / README.md
Created December 7, 2017 15:27 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
@hungdev
hungdev / gist:341cc224754d54ce0e6fc4f1cbd33f70
Last active February 13, 2018 17:30
Config release google signin

Để release cho google signin phải add mã sha1 release chứ không phải mã sha1 như lúc debug.

Bước 1: tạo my-release-key.keystore

tạo key này như hướng dẫn của bên docs (https://facebook.github.io/react-native/docs/signed-apk-android.html)

thì phải vô đường dẫn này C:\Program Files\Java\jdkx.x.x_x\bin. (trên windows)

còn trên mac sẽ là /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/bin/keytool (trên mac)

@hungdev
hungdev / gist:6c5af93bf5321a6d73c85c90c9d07c76
Created March 11, 2018 07:22
config permission camera roll for ios
https://facebook.github.io/react-native/docs/linking-libraries-ios.html
https://useyourloaf.com/blog/privacy-settings-in-ios-10/
Privacy - Media Library Usage Description
@hungdev
hungdev / gist:06b471e5c800c117a2c10c8ac752ba6b
Last active March 20, 2018 12:41
Configuration with name 'default' not found.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'.
> Configuration with name 'default' not found.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
import PropTypes from 'prop-types'
const propTypes = {
codeLength: PropTypes.number.isRequired
}
const defaultProps = {
codeLength: 5
}
  static navigationOptions ({ navigation }) {
    const { category } = navigation.state.params
    if (!category.parentId) {
      return {
        title: category.name,
        headerRight: (
          <TouchableOpacity onPress={() => navigation.state.params.handleCreate()} style={{ marginRight: 20 }}>
            <Ionicons name='ios-add-circle-outline' size={30} color='#fff' />
 
@hungdev
hungdev / ref_and_refs.md
Last active May 24, 2018 02:58
ref and refs
<ValidatePinModal
  onSubmit={(code) => this.onSubmit(code)}
  // ref='ValidatePinModal'
  ref={ref => {this.ValidatePinModal = ref}}
/>

must has onOpen() func

@hungdev
hungdev / refs.md
Last active May 29, 2018 04:07
can not call refs because...

in some case, you cant call refs and get error:

undefined is not a function(evaluating'_this.refs.ModalPicker.onOpen()')

to solve this issue.

comment this lines