This file contains 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
import _ from 'lodash'; | |
// -- ui | |
import React, { useEffect, useState } from 'react'; | |
import { View, TouchableOpacity, Text } from 'react-native'; | |
import StarRating from 'components/rating_screen/star_rating'; | |
import RatingQuestionnaires from 'components/rating_screen/rating_questionnaires' | |
import ActionSheetModal from 'components/action_sheet_modal'; | |
import PropTypes from 'prop-types'; |
This file contains 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
import React from 'react'; | |
import { DefaultTheme, NavigationContainer } from '@react-navigation/native'; | |
import MainNavigator from './main.navigator'; | |
import { navigationRef } from './root_navigation'; | |
/* | |
* Navigation theming: https://reactnavigation.org/docs/en/next/themes.html | |
*/ | |
const navigatorTheme = { | |
...DefaultTheme, |
This file contains 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
const loadingReducer = (state = {}, action) => { | |
const { type } = action; | |
const matches = /(.*)_(START|SUCCESS|FAIL)/.exec(type); | |
// not a *_START / *_SUCCESS / *_FAILURE actions, so we ignore them | |
if (!matches) return state; | |
const [, requestName, requestState] = matches; | |
return { | |
...state, |
This file contains 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
this.props.navigation.state.routeName |
This file contains 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
let token = bearerHeader.split(' ')[1]; |
This file contains 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 without try and catch will work but it immitates the behavior of try and catch block | |
exports.create = async (req, res) => { | |
let params = req.body; | |
params = { ...params, draw_date: getDateAndYear() }; | |
const filter = { user_id: params.user_id }; | |
const { coins } = await User.findOne(filter).select('coins'); | |
if (coins >= BET_AMOUNT) { |
This file contains 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
module.exports = function isLoggedIn(req, res, next) { | |
if (req.user) { | |
next(); | |
} else { | |
// return unauthorized | |
res.send(401, "Unauthorized"); | |
} | |
}; |
This file contains 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
brew upgrade php |
This file contains 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 HomeScreen({ navigation }) { | |
return ( | |
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}> | |
<Text>Home Screen</Text> | |
<Button | |
title="Go to Details" | |
onPress={() => { | |
/* 1. Navigate to the Details route with params */ | |
navigation.navigate('Details', { | |
itemId: 86, |
This file contains 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
Step 1: just open terminal and run or ctl + c to stop and save | |
xcrun simctl io booted recordVideo filename.mp4 |
NewerOlder