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, { Component } from 'react'; | |
| class Button extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.color = 'blue'; | |
| } | |
| render() { | |
| return <button class={`button-${this.color}`}>Click me</button> |
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, { Component } from 'react'; | |
| class MyComponent extends Component { | |
| constructor(props) { | |
| this.firstName = props.firstName; | |
| this.lastName = props.lastName; | |
| this.url = props.url; | |
| } | |
| render() { |
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, { Component } from 'react'; | |
| class MyComponent extends Component { | |
| constructor(props) { | |
| this.state = { | |
| clicks: 0 | |
| }; | |
| } | |
| componentDidMount() { |
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
| foo = (element, $timeout) -> | |
| $timeout -> | |
| bindElement = element | |
| isSwitchElement = -> element[0].scrollWidth == undefined && scope.field?.type == 'text' | |
| bindElement = element.next() if isSwitchElement(element) | |
| scope.tooltipEnabled = bindElement[0].scrollWidth > bindElement[0].offsetWidth |
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
| function* KindBotGenerator() { | |
| const prompt = 'Hello, what\'s your name?'; | |
| const answer = yield prompt; | |
| return `Hello, ${answer}! :)`; | |
| } | |
| const kindBot = KindBotGenerator(); | |
| console.log(kindBot.next().value); // Hello, what's your name? |
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
| function* KindBotGenerator() { | |
| const prompt = 'Hello, what\'s your name?'; | |
| const answer = yield prompt; | |
| return `Hello, ${answer}! :)`; | |
| } | |
| const kindBot = KindBotGenerator(); | |
| console.log(kindBot.next().value); // Hello, what's your name? |
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 request from 'request'; | |
| import bluebird from 'bluebird'; | |
| const ronQuotesAPI = 'https://ron-swanson-quotes.herokuapp.com/v2/quotes'; | |
| const extractText = quote => JSON.parse(quote.body)[0]; | |
| const asyncRequest = bluebird.promisifyAll(request); | |
| const getRonQuotes = bluebird.coroutine(function* () { | |
| const quotes = []; |
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 request from 'request'; | |
| import bluebird from 'bluebird'; | |
| const ronQuotes = 'https://ron-swanson-quotes.herokuapp.com/v2/quotes'; | |
| const extractText = quote => JSON.parse(quote.body)[0]; | |
| const asyncRequest = bluebird.promisifyAll(request); | |
| const getRonQuotes = () => { | |
| const quotes = []; |
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 request from 'request'; | |
| const ronQuotes = 'https://ron-swanson-quotes.herokuapp.com/v2/quotes'; | |
| const extractText = quote => JSON.parse(quote.body)[0]; | |
| const getRonQuotes = (cb) => { | |
| const quotes = []; | |
| request.get(ronQuotes, (err1, res1) => { | |
| if (err1) throw Error(err1); |
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
| [MASTER] | |
| # Specify a configuration file. | |
| #rcfile= | |
| # Python code to execute, usually for sys.path manipulation such as | |
| # pygtk.require(). | |
| #init-hook= | |
| # Add files or directories to the blacklist. They should be base names, not |