echo 'export PATH="${HOME}/.local/bin:$PATH"' >> ~/.bashrc
This file contains hidden or 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, { useState, useRef, useEffect } from "react"; | |
| import { | |
| StyleSheet, | |
| Dimensions, | |
| View, | |
| Text, | |
| TouchableOpacity, | |
| SafeAreaView, | |
| } from "react-native"; | |
| import { Camera } from "expo-camera"; |
This file contains hidden or 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, {Component} from 'react'; | |
| import {View, TouchableOpacity, Dimensions, Text} from 'react-native'; | |
| import Orientation from 'react-native-orientation-locker'; | |
| import FontAwesome from 'react-native-vector-icons/FontAwesome'; | |
| import {RNCamera} from 'react-native-camera'; | |
| import * as Animatable from 'react-native-animatable'; | |
| const SCREEN_HEIGHT = Dimensions.get('window').height; | |
| const SCREEN_WIDTH = Dimensions.get('window').width; |
This file contains hidden or 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
| { | |
| // The plugin looks for a .jsbeautifyrc file in the same directory as the | |
| // source file you're prettifying (or any directory above if it doesn't exist, | |
| // or in your home folder if everything else fails) and uses those options | |
| // along the default ones. | |
| // Details: https://github.com/victorporof/Sublime-HTMLPrettify#using-your-own-jsbeautifyrc-options | |
| // Documentation: https://github.com/einars/js-beautify/ | |
| "html": { | |
| "allowed_file_extensions": ["htm", "html", "xhtml", "shtml", "xml", "svg", "dust"], |
This file contains hidden or 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
| {"contents":{"editor":{"formatOnSave":true}},"overrides":[],"keys":["editor.formatOnSave"]} |
This file contains hidden or 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
| axios.get('/user/12345') | |
| .catch(function (error) { | |
| if (error.response) { | |
| // The request was made and the server responded with a status code | |
| // that falls out of the range of 2xx | |
| console.log('data', error.response.data); | |
| console.log('status', error.response.status); | |
| console.log('headers', error.response.headers); | |
| } else if (error.request) { | |
| // The request was made but no response was received |
This file contains hidden or 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 = { | |
| root: true, | |
| extends: '@react-native-community', | |
| rules: { | |
| 'prettier/prettier': 0, // Disables prettier | |
| 'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks | |
| 'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies | |
| 'react/no-unused-state': 'error', // Checks for unused state properties | |
| 'react/no-did-mount-set-state': 'off', | |
| 'react-native/no-unused-styles': 2, |
This file contains hidden or 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
| class TutorUserSignUpForm(forms.ModelForm): | |
| def __init__(self, *args, **kwargs): | |
| self.user = kwargs.pop('user', None) | |
| super(TutorUserSignUpForm, self).__init__(*args, **kwargs) | |
| self.helper = FormHelper(self) | |
| profile = Profile.objects.get(pk=self.user.pk) | |
| self.initial['firstname'] = profile.firstname | |
| self.initial['lastname'] = profile.lastname |
This file contains hidden or 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
| class TutorRegister(CreateView): | |
| model = TUser | |
| form_class = TutorUserSignUpForm | |
| template_name = 'FindTutors/tutor_signup.html' # correct form HTML | |
| def form_valid(self, form): | |
| user = form.save(commit=False) | |
| user.is_tutor = True | |
| user.save() |