02 2021 档案
摘要:Let's say we have a date picker compoent which display start date and end date. We want to make sure that start date is no later than end date, if it
阅读全文
摘要:Apollo Client is a comprehensive state management library for JavaScript that enables you to manage both local and remote data with GraphQL. Use it to
阅读全文
摘要:In functions/graphql/index.js file: const { ApolloServer, gql } = require("apollo-server-lambda"); const typeDefs = gql` type Query { todos: [Todo]! }
阅读全文
摘要:Serverless AWS lambda Config serverless with aws serverless config credentials --provider aws --key <ACCESS_KEY_AWS> --secret <SECRET_KEY_AWS> Init pr
阅读全文
摘要:Choose a "Hosted zones" (the application we created) A Version with 90% weight B Version with 10% weight Blue/Green deployment whitepaper
阅读全文
摘要:During the deployment, if you have any external files you need to add into build process. You can save those files into S3. Then pulling those files i
阅读全文
摘要:const items = [ 'Sojourner', 'Opportunity', 'Spirit', 'Curiosity', 'Perseverance', ] const formatter = new Intl.ListFormat('en', { style: 'long', type
阅读全文
摘要:1. Download the git repo into local. 2. Copy the SSH / HTTPS URL from CodeCommit Repo Then run: git remote set-url origin ssh://code-commit.address.xx
阅读全文
摘要:.ow { overflow-wrap: break-word; word-wrap: break-word; hyphens: auto; white-space: normal } Post
阅读全文
摘要:Read Dependency Confusion: How I Hacked Into Apple, Microsoft and Dozens of Other Companies Yarn: yarn install –immutable --immutable-cache --checkcac
阅读全文
摘要:Schedule timed jobs on macOS with launchd launchd is a robust scheduled job automation tool on macOS that allows you to schedule a task to be run at r
阅读全文
摘要:Getopts Let’s say you want to allow a user to pass a -v flag to turn on verbose logging in a script. Manually parsing out options passed to a script i
阅读全文
摘要:Case Basic case "$1" in a) echo "a match";; b) echo "b match";; c) echo "c match" ;; *) echo "none of the case match" exit 1;; esac If we run: ./case_
阅读全文
摘要:Git hooks In root of project: mkdir -p hooks cd hooks touch post-merge post-merge: #! /bin/bash # all stdio in this script after this line will be sen
阅读全文
摘要:In this lesson, we'll apply our jq skills and write a script that gets a list of dependencies from package.json and greps for usages of every package.
阅读全文
摘要:jq Bash, unfortunately, doesn’t ship with a command that can work with JSON natively. In this lesson, we’ll learn how to read and do basic queries on
阅读全文
摘要:Shell Parameter Exapnsion In this lesson, we'll see how shell parameter expansions can be used to simply expand a variable's valuable and also provide
阅读全文
摘要:Shortcut For example we have a long command: curl -i http://example.com Ctrl + a Move to the beginning of the line Ctrl + e Move to the end of the lin
阅读全文
摘要:!! & !& History expansions let you interact with bash's history. For example, if you forgot to run a command with sudo, you can sudo !! to rerun the l
阅读全文
摘要:Copy Brace expansions are commonly used with the cp or mv commands in order to dynamically generate strings. In this lesson, we'll use a brace expansi
阅读全文
摘要:$PATH PATH is a global environment variable that represents a list of directories bash looks in for executable files. The executable files for bash co
阅读全文
摘要:TypeScript can infer the type of a variable by looking at the data assigned to it. It also allows you to create a reusable type that it has inferred a
阅读全文
摘要:You can use the non-null assertion operator in TypeScript to take a typed variable and remove the undefined and null types from it. In this lesson, we
阅读全文
摘要:Pipes (|) are one of the most powerful features in bash and allow you to efficiently chain commands together and send data through it. We'll also look
阅读全文
摘要:Knowing how conditionals work in bash open up a world of scripting possibilities. We’ll learn the basic syntax, including if, else, and elif. Then we'
阅读全文
摘要:Every command in bash returns an exit status, which is an integer between 0 and 255 that represents whether the command succeeded or failed, and if it
阅读全文
摘要:Chmod ## Create a file vim script.sh ## output some content echo "Hello World" ## Run the script ./script.sh It ouput permission denied: ./script.sh.
阅读全文
摘要:Create a script See Chmod.md, how to create a sh file and modify premisson to exec mode. Parameters Paramters are referred by $1, $2.... For example:
阅读全文
摘要:Open folder When you want to open a folder in Finder, for example your current folder: open . open .git ## you can open the hidden folder Create folde
阅读全文
摘要:Viewing file Viewing the whole file: cat package.json Viewing the whole file with line number cat -n package.json Viewing the file with pagination les
阅读全文
摘要:Docker containers should be designed to be stateless, meaning that they can survive system reboots and container terminations gracefully, and without
阅读全文
摘要:Objects have the ability to use data and methods that other objects contain, as long as it lives on the [[prototype]] chain. In this lesson we’ll test
阅读全文
摘要:A properly scaled Docker architecture should be able to kill off random containers at any time, and continue to run by implementing a crash-only desig
阅读全文
摘要:Using React hooks like useState makes it easy to manage things like a shopping cart, but that state may only be available one instance at a time. What
阅读全文
摘要:docker tag k8scourse-front <yourname>/k8scourse-front docker tag k8scourse-back <yourname>/k8scourse-back docker push <yourname>/k8scourse-front docke
阅读全文
摘要:So far, you’ve managed to get all of your containers running on your local machine. That is great for your development environment and you are almost
阅读全文
摘要:This lesson uses some advanced concepts and some bash scripting to build a better Dockerfile. By using the concepts showed here, you will be able to b
阅读全文