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
from time import sleep | |
import signal | |
import sys | |
def on_stop_handler(signum, frame): | |
print 'Exiting application...' | |
sys.exit(0) |
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
class Player extends React.Component { | |
constructor() { | |
super() | |
this.state = { score: 0 } | |
} | |
increaseScore() { | |
// 1. Get previous state from this.state | |
this.setState({ score: this.state.score + 1 }) |
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 arr = [ | |
() => this.setState({moveCircleToMiddle: true}), | |
1000, | |
() => this.setState({showGrayCircle: true}), | |
() => this.setState({showMicrophone: true}), | |
500, | |
() => this.setState({moveCircleToTop: true}), | |
1000, | |
() => this.setState({pulseGrayCircle: true}), | |
500, |
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
class BinaryTree { | |
constructor(value, left = null, right = null) { | |
this.value = value; | |
this.left = left; | |
this.right = right; | |
} | |
* [Symbol.iterator]() { | |
yield this.value; |