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 { StyleSheet, | |
Button, | |
Text, | |
View, | |
TextInput, | |
ImageBackground, | |
ActivityIndicator, | |
Linking, | |
TouchableOpacity } 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, { Component } from 'react'; | |
import { | |
StyleSheet, | |
Button, | |
Text, | |
View, | |
TextInput, | |
ImageBackground, | |
ActivityIndicator, | |
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
import javax.crypto.*; | |
import javax.crypto.spec.IvParameterSpec; | |
import java.io.*; | |
import java.security.InvalidAlgorithmParameterException; | |
import java.security.InvalidKeyException; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.SecureRandom; | |
public class Main { |
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
const fetch = require('node-fetch'); // fetch polyfill in node.js; not required in front end situation | |
// returns an promise, so it can be used by await | |
async function getTodo(id) { | |
return new Promise((resolve, reject) => { | |
fetch('https://jsonplaceholder.typicode.com/todos/' + id) | |
.then(response => response.json()) | |
.then(json => { | |
// success | |
// return data through resolve |
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
const fetch = require('node-fetch'); // fetch polyfill in node.js; not required in front end situation | |
// returns an promise, so it can be used by await | |
async function getTodo(id) { | |
return new Promise((resolve, reject) => { | |
fetch('https://jsonplaceholder.typicode.com/todos/' + id) | |
.then(response => response.json()) | |
.then(json => { | |
// success | |
// return data through resolve |
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
// convert a csv like array like this: | |
// const tourdates = [ | |
// ["date", "venue", "city"], | |
// ["jan 1", "paladium", "worcester"], | |
// ["jan 2", "irving", "nyc"], | |
// ["jan 3", "gramercy", "nyc"] | |
// ]; | |
// into objects, like this: |
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
// convert a csv file to form like texts | |
// Convert a csv like this: | |
// Name,Age, Bob,30, John,40, | |
// To text like this: | |
// Name: Bob Age: 30 |
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
// algorithm question | |
// how to solve the buy - sell problem | |
// q: [3,5,6,9,2] | |
// a: 6 | |
// init best dff = 3-5 | |
// for each number in array | |
// loop each number after the 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 {withStyles} from '@material-ui/core/styles'; | |
import withResizeAware from '../../../core/withResizeAware'; | |
const styles = { | |
root: { | |
flex: 1, | |
padding: 10 | |
}, | |
container: { |
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'; | |
function withResizeAware(WrappedComponent) { | |
return class extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
height: document.documentElement.clientHeight, | |
width: document.documentElement.clientWidth |
OlderNewer