Include in the imports:
import "regexp"As we know, the main idea of React Applications is that they are single page. There is just ONE HTML file, and ONE JavaScript file (although we cound split it up - more on that another day). This means that we do not have different physical files for different pages in our Application. E.g. we do not have index.html for the homepage, about.html for the About page, blog.html for the blog page. This was one of the key differences we discovered when we started using React, as opposed to when we were just using HTML. With React, all the content and logic is written in JavaScript and injected into a single HTML page.
At the end of the day, when we bundle our development code, these are the files we get:
index.htmlbundle.js| #!/bin/bash | |
| set -ex | |
| GROUP_NAME=$1 | |
| NAMESPACE=$2 | |
| # Critical | |
| aws logs put-metric-filter \ | |
| --log-group-name ${GROUP_NAME} \ |
| #!/bin/bash | |
| set -ex | |
| NAMESPACE=$1 | |
| ALARM_NAME_PREFIX=$2 | |
| # Error | |
| aws cloudwatch put-metric-alarm \ | |
| --alarm-name "$ALARM_NAME_PREFIX Error Count" \ |
| class FooSpec | |
| def self.describe(message, &block) | |
| puts message | |
| FooSpec.class_eval &block | |
| end | |
| def self.context(message, &block) | |
| puts message | |
| FooSpec.class_eval &block | |
| end |
| #!/bin/bash | |
| # A script that outputs each number from start to end | |
| # -s 1 to start at one | |
| # -e 20 to end at 20 | |
| # -b to count backwards | |
| # final argument is prefix to all the numbers | |
| # e.g. count -s 1 -e 20 -b NUM_ | |
| reverse=0 |
Here are some posible solutions with explanations for Bash Practice Exercises. They are not necessarily the only or the best solutions - there is a preference for using a series of simple commands piped to one another.
#!/bin/bash
# Using an error exit code to make sure the program does not continue.
# Exiting with anything other than 0 signifies an error.