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, { useEffect } from 'react'; | |
import { StyleSheet, Text, View, TouchableOpacity } from 'react-native'; | |
import { SQLite } from 'expo-sqlite' | |
import { BaseModel, types } from 'expo-sqlite-orm'; | |
import DatabaseLayer from 'expo-sqlite-orm/src/DatabaseLayer'; | |
import Store from 'react-native-store'; | |
const DB = { | |
'foo': Store.model('foo'), | |
'bar': Store.model('bar') |
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
version: 2 | |
references: | |
container_config: &container_config | |
docker: | |
- image: circleci/node:latest | |
install_expo_cli: &install_expo_cli | |
run: | |
name: install-expo-cli | |
command: sudo npm install -g expo-cli |
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 { GLView } from 'expo'; | |
import Expo2DContext from 'expo-2d-context'; | |
import React from 'react'; | |
import { View, Button } from 'react-native'; | |
export default class App extends React.Component { | |
render() { | |
return [ | |
<GLView | |
ref={ref => { | |
this.gl = ref; |
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
version: 2 | |
references: | |
container_config: &container_config | |
docker: | |
- image: circleci/node:latest | |
environment: | |
EXPO_ACCOUNT: "expo_account_name" | |
EXPO_PASSWORD: "expo_account_password" | |
APP_SLUG: "expo_app_slug" |
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
#!/bin/bash | |
max=3000000 | |
maxWidth=2000 | |
maxHeight=1000 | |
for file in `\find ./docs -maxdepth 2 -name '*.png'`; do | |
hoge=$(identify -format "%w %h" $file) | |
IFS=' ' |
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 uuid from 'uuid'; | |
import * as firebase from 'firebase'; | |
import 'firebase/firestore'; | |
firebase.initializeApp(config); | |
firebase.firestore().settings({ timestampsInSnapshots: true }); | |
const uploadFileAsync = async (uri) => { | |
const ext = uri.split('.').slice(-1)[0]; | |
const path = `file/${this.uid}/${uuid.v4()}.${ext}`; |
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 * as React from 'react'; | |
import { Text, View, StyleSheet,TouchableOpacity,CameraRoll,Linking } from 'react-native'; | |
import { Constants,FileSystem,Permissions } from 'expo'; | |
export default class App extends React.Component { | |
onPress = async () => { | |
const filePath = `${FileSystem.documentDirectory}share-movie.mp4`; | |
const res = await FileSystem.downloadAsync('http://techslides.com/demos/sample-videos/small.mp4', filePath); | |
// const i = await FileSystem.getInfoAsync(res.uri); | |
// console.log(i); |
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 { BottomTabBar } from 'react-navigation-tabs'; | |
const TabBar = (props) => { | |
const { navigation = {} } = props; | |
const { state = {} } = navigation; | |
let newProps = props; | |
if (state.index === 0) { | |
newProps = Object.assign( |
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 progressFetch = (url, options = {}, onProgress = {}) => new Promise((res, rej) => { | |
const xhr = new XMLHttpRequest(); | |
xhr.open(options.method || 'post', url); | |
Object.keys(options.headers || {}).forEach((k) => { | |
xhr.setRequestHeader(k, options.headers[k]); | |
}); | |
xhr.onload = e => res(e.target.responseText); | |
xhr.onerror = rej; |
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 { TextInput as Input } from 'react-native'; | |
export default class TextInput extends React.Component { | |
static defaultProps = { | |
onFocus: () => { }, | |
} | |
constructor(props) { | |
super(props); |
NewerOlder