This file contains 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
2020/12/04 14:17:58 [INFO] Terraform version: 0.13.5 | |
2020/12/04 14:17:58 [INFO] Go runtime version: go1.14.7 | |
2020/12/04 14:17:58 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply", "--auto-approve"} | |
2020/12/04 14:17:58 [DEBUG] Attempting to open CLI config file: /Users/paschalidi/.terraformrc | |
2020/12/04 14:17:58 [DEBUG] File doesn't exist, but doesn't need to. Ignoring. | |
2020/12/04 14:17:58 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins | |
2020/12/04 14:17:58 [DEBUG] ignoring non-existing provider search directory /Users/paschalidi/.terraform.d/plugins | |
2020/12/04 14:17:58 [DEBUG] ignoring non-existing provider search directory /Users/paschalidi/Library/Application Support/io.terraform/plugins | |
2020/12/04 14:17:58 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins | |
2020/12/04 14:17:58 [INFO] CLI command args: []string{"apply", "--auto-approve"} |
This file contains 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: CI/CD | |
on: [push, pull_request] | |
jobs: | |
run-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [10.x] |
This file contains 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 from 'react'; | |
const withStorage = (WrappedComponent) => { | |
class HOC extends React.Component { | |
state = { | |
localStorageAvailable: false, | |
}; | |
componentDidMount() { | |
this.checkLocalStorageExists(); |
This file contains 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
class SubmitButton extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
isFormSubmitted: false | |
}; | |
this.handleSubmit = this.handleSubmit.bind(this); | |
} | |
handleSubmit() { |
This file contains 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
Answer: | |
The constructor does not pass its props to the super class. It should include the following line: | |
constructor(props) { | |
super(props); | |
// ... | |
} | |
The event listener (when assigned via addEventListener()) is not properly scoped because ES2015 doesn’t provide autobinding. Therefore the developer can re-assign clickHandler in the constructor to include the correct binding to this: | |
constructor(props) { | |
super(props); |
This file contains 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 element = ( | |
<h1 className="greeting"> | |
Hello, world! | |
</h1> | |
); | |
// answer | |
const element = React.createElement( | |
'h1', | |
{className: 'greeting'}, |
This file contains 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
function foo() { | |
// All variables are accessible within functions. | |
var bar = 'bar'; | |
let baz = 'baz'; | |
const qux = 'qux'; | |
console.log(bar); | |
console.log(baz); | |
console.log(qux); | |
} |
This file contains 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
function Person(name) { | |
this.name = name; | |
} | |
var person = Person('John'); | |
console.log(person); | |
console.log(person.name); | |
var person = new Person('John'); | |
console.log(person); |
This file contains 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
<html> | |
<head> | |
<title>DOM!!!</title> | |
</head> | |
<body> | |
<h1 id="one">Welcome</h1> | |
<p>This is the welcome message.</p> | |
<h2>Technology</h2> | |
<p>This is the technology section.</p> | |
<script type="text/javascript"> |
This file contains 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
var people = [ | |
{ name: 'John Hill', age: 22 }, | |
{ name: 'Jack Chill', age: 27 } | |
]; | |
var getInitials = function( name ) { | |
// Reusing the name argument makes little sense in general. | |
// We are making this assignment here for demonstrating | |
// the difference between value types and reference types. | |
name = name.split( ' ' ).map( function( word ) { |
NewerOlder