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
packages: | |
yum: | |
ImageMagick: [] | |
ImageMagick-devel: [] | |
container_commands: | |
01-wget: | |
command: "wget -O /tmp/ffmpeg.tar.xz https://johnvansickle.com/ffmpeg/release-source" | |
02-mkdir: | |
command: "if [ ! -d /opt/ffmpeg ] ; then mkdir -p /opt/ffmpeg; fi" | |
03-tar: |
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
// Create a theme context, defaulting to light theme | |
const ThemeContext = React.createContext('light'); | |
function ThemedButton(props) { | |
// The ThemedButton receives the theme from context | |
return ( | |
<ThemeContext.Consumer> | |
{theme => <Button {...props} theme={theme} />} | |
</ThemeContext.Consumer> | |
); |
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
package main | |
import ( | |
"fmt" | |
"image" | |
_ "image/jpeg" | |
_ "image/png" | |
"log" | |
"net/http" | |
) |
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 { | |
Text, | |
TouchableOpacity, | |
Image, | |
View, | |
FlatList, | |
Dimensions, | |
StatusBar, | |
} from 'react-native'; |
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 { TextInput as Input } from 'react-native'; | |
export default class TextInput extends React.Component { | |
static defaultProps = { | |
onFocus: () => { }, | |
} | |
constructor(props) { | |
super(props); |
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 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 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 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 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}`; |