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, Animated, FlatList, PlatformOS } from 'react-native'; | |
import { Constants } from 'expo'; | |
const HEADER_HEIHT = 55; | |
export default class App extends React.Component { | |
data = new Array(20).fill(1); | |
scrollY = new Animated.Value(0); |
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
open Webapi.Dom; | |
open Webapi.Canvas.CanvasElement; | |
open Point; | |
open App; | |
open Draw; | |
let worldMaxSize = 400.0; | |
let tick = (world) => { | |
world |
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
open Webapi.Dom; | |
open Webapi.Canvas.Canvas2d; | |
open Webapi.Canvas.CanvasElement; | |
[@bs.set] external setWidth: (Dom.element, int) => unit = "width"; | |
[@bs.set] external setHeight: (Dom.element, int) => unit = "height"; | |
type point = (float, float); | |
type shape('s, 'a) = { |
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
open Webapi.Dom; | |
open Webapi.Canvas.Canvas2d; | |
open Webapi.Canvas.CanvasElement; | |
type position = (float, float); | |
type shape('s, 'a) = { | |
state: 's, | |
reducer: ('a, 's) => 's, | |
render: (shape('s, 'a)) => unit |
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 } from 'react-native'; | |
import { Constants } from 'expo'; | |
import { createBottomTabNavigator, createAppContainer, createStackNavigator } from 'react-navigation' | |
const routes = { | |
TodoList: createStackNavigator({ | |
TodoList: { | |
screen: ({ navigation }) => ( |
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 routes = { | |
Home: { | |
screen: () => ( | |
<View style={styles.container}> | |
<Text style={styles.paragraph}>Home Screen</Text> | |
</View> | |
), | |
navigationOptions: { | |
tabBarLabel: () => ( | |
<Text>own label</Text> |
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 } from 'react-native'; | |
import { Constants } from 'expo'; | |
import { createStackNavigator, createAppContainer } from 'react-navigation' | |
const routes = { | |
Home: () => ( | |
<View style={styles.container}> | |
<Text style={styles.paragraph}>Home Screen</Text> | |
</View> |
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 express = require('express') | |
const mongoose = require('mongoose') | |
const bodyParser = require('body-parser') | |
const app = express() | |
const router = express.Router() | |
async function privateRoute(req, res, next) { | |
const token = req.header('Auth') |
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 bableSortFor() { | |
const data = [1, 4, 5, 7, 3, 9, 8] | |
let c = 0 | |
for (let i = 0; i < data.length; i++) { | |
for (let j = 0; j < (data.length - 1) - i; j++) { | |
c += 1 | |
if (data[j] > data[j + 1]) { | |
const tmp = data[j] |