1. Create new app
npx create-react-app myapp
2. Edit workspace settings in vscode for flow typechecking
{
"flow.useNPMPackagedFlow": true,
"javascript.validate.enable": false
| const path = require("path"); | |
| const withTypescript = require("@zeit/next-typescript"); | |
| const withCSS = require("@zeit/next-css"); | |
| const withSourceMaps = require("@zeit/next-source-maps"); | |
| const r = require("regexr"); | |
| const cssConfig = { | |
| cssModules: false | |
| }; |
| import NextLink from 'next/link'; | |
| import React from 'react'; | |
| import { Text } from 'react-native-web'; | |
| // https://github.com/zeit/next.js#with-link | |
| // Combines the Next.js <Link> with React Native's <Text> component. | |
| // Enables use like this: | |
| // | |
| // <Link | |
| // href={href} |
| import * as t from 'io-ts' | |
| import * as React from 'react' | |
| import { render } from 'react-dom' | |
| type Field = t.StringType | t.NumberType | t.BooleanType | |
| interface Form extends t.InterfaceType<{ [key: string]: Field }> {} | |
| const toReactElement = (f: Form | Field): React.ReactElement<any> => { | |
| // f is a tagged union | |
| switch (f._tag) { |
1. Create new app
npx create-react-app myapp
2. Edit workspace settings in vscode for flow typechecking
{
"flow.useNPMPackagedFlow": true,
"javascript.validate.enable": false
| <!-- | |
| Description: The following is the example code to use recaptcha. | |
| Notice: The function backend_API_challenge is the concept and you should implement it on the backend. | |
| Especially, you must keep your secret key in private all the time. | |
| Flow: | |
| 1. Click the submit button. | |
| 2. On the console, execute backend_API_challenge function. | |
| --> | |
| <html> | |
| <head> |
| **Jeff Escalante** | |
| # Dato & Contentful | |
| There are many areas in which I'd consider Dato to be much stronger of a CMS than | |
| contentful, and one in which I'd consider the opposite to be the case. I will try to be as | |
| balanced as possible with this overview, as I am not employed by dato or anything ‐ my | |
| goal is to ensure that my clients and developers get the best possible experience working | |
| with a CMS. |
| import { mapState } from 'vuex' | |
| export default function mapStatesTwoWay (namespace, states, updateCb) { | |
| const mappedStates = mapState(namespace, states) | |
| const res = {} | |
| for (const key in mappedStates) { | |
| res[key] = { | |
| set (value) { | |
| updateCb.call(this, { [key]: value }) | |
| }, |
| { | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "name": "Example", | |
| "type": "node", | |
| "request": "launch", | |
| "runtimeExecutable": "node", | |
| "runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"], |
| 'use strict'; | |
| const crypto = require('crypto'); | |
| const ENC_KEY = "bf3c199c2470cb477d907b1e0917c17b"; // set random encryption key | |
| const IV = "5183666c72eec9e4"; // set random initialisation vector | |
| // ENC_KEY and IV can be generated as crypto.randomBytes(32).toString('hex'); | |
| const phrase = "who let the dogs out"; | |
| var encrypt = ((val) => { |
| /** | |
| * Copyright (c) 2015, Facebook, Inc. | |
| * All rights reserved. | |
| * | |
| * This source code is licensed under the BSD-style license found in the | |
| * LICENSE file in the root directory of this source tree. An additional grant | |
| * of patent rights can be found in the PATENTS file in the same directory. | |
| * | |
| * @providesModule normalizeWheel | |
| * @typechecks |