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
| // Duplicates: Bob, Aaron, Frank | |
| const arrayWithDuplicates = ["Aaron", "Bob", "Chris", "Dave", "Edward", "Bob", "Aaron", "Frank", "George", "Frank", "Henry", "Bob", "Bob", "Aaron", "Aaron", "Frank"]; | |
| function findDuplicates(arrayWithDuplicates) { | |
| let duplicates = []; | |
| arrayWithDuplicates.forEach( (value, index) => { | |
| const indexWhereValueFirstAppears = arrayWithDuplicates.findIndex( (value_) => { | |
| return value_ === value; | |
| }); | |
| const indexWhereValueLastAppears = arrayWithDuplicates.lastIndexOf(value); |
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
| // DEMO: Using Union-Types in TypeScript | |
| // Question: What are Union Types??? | |
| // Answer: Union Types are TypeScript types which can be equal to many different types which often share 'union' properties amongst the various different types. For example, an Athlete Union-Type could be used to represent FootballPlayer, BasketballPlayer, and BaseballPlayer types | |
| type FootballPlayer = { | |
| firstName: string, | |
| lastName: string, | |
| jerseyNumber: number, |
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 from 'react'; | |
| import { | |
| SafeAreaView, | |
| StyleSheet, | |
| ScrollView, | |
| View, | |
| Text, | |
| StatusBar, | |
| } from 'react-native'; |
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
| $ cd Desktop | |
| $ mkdir HelloDjango | |
| $ cd HelloDjango | |
| // Create Virtual Environment with Python's venv | |
| $ python -m venv env |
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
| signingConfigs { | |
| debug { | |
| storeFile file('debug.keystore') | |
| storePassword 'android' | |
| keyAlias 'androiddebugkey' | |
| keyPassword 'android' | |
| } | |
| release { |
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
| signingConfigs { | |
| release { | |
| if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) { | |
| storeFile file(MYAPP_UPLOAD_STORE_FILE) | |
| storePassword MYAPP_UPLOAD_STORE_PASSWORD | |
| keyAlias MYAPP_UPLOAD_KEY_ALIAS | |
| keyPassword MYAPP_UPLOAD_KEY_PASSWORD | |
| } | |
| } | |
| } |
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 from 'react'; | |
| import { | |
| SafeAreaView, | |
| StyleSheet, | |
| ScrollView, | |
| View, | |
| Text, | |
| StatusBar, | |
| } from 'react-native'; |
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 from 'react'; | |
| import { | |
| SafeAreaView, | |
| StyleSheet, | |
| ScrollView, | |
| View, | |
| Text, | |
| StatusBar, | |
| Button, | |
| Linking, |
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
| let oldArray = ["foo", "bar", "baz"]; | |
| let newArray = oldArray.map( (item) => { | |
| if (item === "baz") { | |
| return "B@Z!"; | |
| } else { | |
| return item; | |
| } | |
| }); |
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
| <Modal | |
| visible={true} | |
| onShow={ () => { this.textInput.focus(); }}> | |
| {/* Adapted From: https://stackoverflow.com/questions/42730400/focus-input-on-load-of-modal-in-react-native */} | |
| <KeyboardAvoidingView style={{}}> | |
| <TextInput | |
| style={{}} |