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 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
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, { Component } from 'react'; | |
import { View, StyleSheet, Image } from 'react-native'; | |
import { Constants } from 'expo'; | |
const mallandro = require('./assets/rah.png'); | |
const HEIGHT = 170; | |
export default class App extends Component { | |
render() { |
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, { Component } from 'react'; | |
import { View, StyleSheet, Picker, TouchableOpacity, Text, TextInput } from 'react-native'; | |
import { withNavigation } from 'react-navigation'; | |
const MAX_LENGTH = 150; | |
const styles = StyleSheet.create({ | |
header: { | |
color: '#9EA0A1', | |
fontSize: 18, |
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, { Component } from 'react'; | |
import { Text, View, StyleSheet, Image, ImageBackground, Platform } from 'react-native'; | |
const backgroundImage = require('../assets/background.png') | |
const iconCamera = require('../assets/camera_alt_white_48x48.png') | |
const styles = StyleSheet.create({ | |
addImage: { | |
flexDirection: 'column', | |
justifyContent: 'center', |
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 arr = [[1,2,[3]],4]; | |
const flattenArray = list => | |
list.reduce( | |
(a, b) => a.concat(Array.isArray(b) ? flattenArray(b) : b), [] | |
); | |
console.log(flattenArray(arr)); |
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
# THIS IS example/android/app/build.gradle | |
apply plugin: "com.android.application" | |
import com.android.build.OutputFile | |
/** | |
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets | |
* and bundleReleaseJsAndAssets). | |
* These basically call `react-native bundle` with the correct arguments during the Android build |
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, { Component } from 'react'; | |
import { BrowserRouter as Router, Route, withRouter } from 'react-router-dom'; | |
import { connect } from 'react-redux'; | |
import Modal from 'react-modal'; | |
import * as uuid from 'uuid/v1'; | |
import { | |
getCategories, | |
getPosts, | |
changeSortOrder, | |
increasePostScore, |
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
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* @flow | |
*/ | |
import React, { Component } from 'react'; | |
import { | |
AppRegistry, |
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
function balancedParentesis(string) { | |
return !string.split("").reduce(function(previous, char) { | |
if (previous < 0) return previous; | |
if (char === "(") return previous + 1; | |
if (char === ")") return previous - 1; | |
return previous; | |
}, 0); | |
} | |
balancedParentesis("))(("); // False |
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
# prompt | |
force_color_prompt=yes | |
# Add git branch if its present to PS1 | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
if [ "$color_prompt" = yes ]; then | |
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ ' | |
else |
NewerOlder