In computing, memoization or memoisation
is an optimization technique used primarily
to speed up computer programs by storing
the results of expensive function calls and
returning the cached result when the same
inputs occur again.
— wikipedia
This file contains hidden or 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 path = require('path'); | |
| const webpack = require('webpack'); | |
| const WebpackNodeExternals = require('webpack-node-externals'); | |
| const ReloadServerPlugin = require('reload-server-webpack-plugin'); | |
| const cwd = process.cwd(); | |
| module.exports = { |
This file contains hidden or 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, { useRef, useState } from 'react'; | |
| import { Typography } from '@material-ui/core'; | |
| import TextField from '@material-ui/core/TextField'; | |
| import CircularProgress from '@material-ui/core/CircularProgress'; | |
| import Autocomplete, { | |
| AutocompleteChangeDetails, | |
| AutocompleteChangeReason, | |
| AutocompleteProps | |
| } from '@material-ui/lab/Autocomplete'; |
This file contains hidden or 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
| module.exports = { | |
| presets: [ | |
| '@babel/preset-react', | |
| [ | |
| '@babel/preset-env', | |
| { | |
| targets: { | |
| node: 'current', | |
| }, | |
| }, |
This file contains hidden or 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
| /** | |
| * Modify the parts you need to get it working. | |
| */ | |
| var should = require('should'); | |
| var request = require('../node_modules/request'); | |
| var io = require('socket.io-client'); | |
| var serverUrl = 'http://localhost'; |
you should review every pull request of your team
- each pull request will make understand what everyone in your team is working on
- it will ensure you keep consistency of file location, and code patterns
- it will catch bugs/regression early on
- it will teach the best way to solve the problem
you should ensure consistency of the code base
you should pair programming with all devs of your team
This file contains hidden or 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 prettyFormat from 'pretty-format'; | |
| const excludeKeys = ['__fragments', '__id', '__fragmentOwner']; | |
| // strip __fragments, __id, __fragmentOwne | |
| export const relayTransform = (key: string, value: string) => { | |
| if (excludeKeys.includes(key)) { | |
| return undefined; | |
| } |
This file contains hidden or 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
| name: Test, Build and Deploy | |
| on: | |
| pull_request: | |
| types: [closed] | |
| jobs: | |
| build-test-release: | |
| if: github.event.action == 'closed' && github.event.pull_request.merged == true | |
| runs-on: ubuntu-latest |
This file contains hidden or 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 { promises } from "fs"; | |
| import crypto from "crypto"; | |
| import path from "path"; | |
| import { print, parse } from "graphql"; | |
| const plugin = { | |
| name: "relay", | |
| setup: build => { | |
| build.onLoad({ filter: /\.tsx$/, namespace: "" }, async args => { | |
| let contents = await promises.readFile(args.path, "utf8"); |
How to:
- create a Docker-based AWS Fargate/ECS deployment
- without the Docker containers having a public IP
- with an Application Load Balancer as reverse proxy / SSL termination proxy sitting in front of the containers
For Fargate/ECS to be able to access your Docker images hosted on ECR (or somewhere else) you'll have to allow outbound internet access to the Fargate subnets. Here's how you do it.