What this will cover
- Host a static website at S3
- Redirect
www.website.comtowebsite.com - Website can be an SPA (requiring all requests to return
index.html) - Free AWS SSL certs
- Deployment with CDN invalidation
| Mix.install( | |
| [ | |
| {:phoenix_playground, "~> 0.1.0"}, | |
| {:openai, "~> 0.6.1"} | |
| ], | |
| config: [ | |
| openai: [ | |
| api_key: System.get_env("OPENAI_API_KEY"), | |
| organization_key: System.get_env("OPENAI_ORGANIZATION_KEY") | |
| ] |
| class App extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| isConnected: true, | |
| } | |
| } | |
| state = { | |
| isConnected: true |
| type Account struct { | |
| Address common.Address | |
| URL URL | |
| } | |
| const AddressLength = 20 | |
| type Address [AddressLength]byte | |
| # views/test/index.rb.erb | |
| <% | |
| @test =1 | |
| %> | |
| <%= @test %> |
| // In App.js in a new project | |
| import React from 'react'; | |
| import { View, Text } from 'react-native'; | |
| import { createStackNavigator } from 'react-navigation'; | |
| class HomeScreen extends React.Component { | |
| render() { | |
| return ( | |
| <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}> |
| import { createStore, applyMiddleware } from ‘redux’; | |
| import { takeEvery, call } from ‘redux-saga/effects’; | |
| import createSegmentTracker from ‘redux-segment-node’; | |
| import { navigateTo } from ‘gatsby-link’; | |
| import { flow } from ‘lodash/fp’; | |
| import { NAVIGATE_TO, GET_CLIENT_INFORMATION } from ‘~/shared/store/app/actionTypes’; | |
| import { SEGMENT_KEY as key } from ‘~/shared/constants’; | |
| import { | |
| middlewares, | |
| sagaMiddleware, |
| /** | |
| * Why is this here you ask? React Native doesn't use Webpack. True. This file is here to trick | |
| * IDEA in recognizing module aliases (see the package.json files in some of the subdirs). | |
| * Nice solution? No. Does it work? Sure. | |
| * Tracker URL: https://youtrack.jetbrains.com/issue/WEB-23221 | |
| * | |
| * - TS | |
| */ | |
| const fs = require('fs') |
| import React from 'react'; | |
| import PropTypes from 'prop-types'; | |
| import { TouchableOpacity, Linking } from 'react-native'; | |
| const AutoLink = ({ children, phone, email, text }) => { | |
| let uriText = text; | |
| uriText = phone ? `tel:${text}` : uriText; | |
| uriText = email ? `mailto:${text}` : uriText; | |
| const _onPress = uri => Linking.openURL(uri).catch(err => console.error('An error occurred', err)); |
| import React from 'react' | |
| import PropTypes from 'prop-types'; | |
| import { Animated, Easing } from 'react-native' | |
| class SlideIn extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| height: new Animated.Value(0), |