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
<!-- variable (usually a property of the current view model --> | |
<div data-bind="visible: shouldShowMessage">...</div> | |
<!-- comparison and conditional --> | |
The item is <span data-bind="text: price() > 50 ? 'expensive' : 'cheap'"></span>. | |
<!-- function call and comparison --> | |
<button data-bind="enable: parseAreaCode(cellphoneNumber()) != '555'">...</button> | |
<!-- function expression --> |
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
<!-- variable (usually a property of the current view model --> | |
<div data-bind="visible: shouldShowMessage">...</div> | |
<!-- comparison and conditional --> | |
The item is <span data-bind="text: price() > 50 ? 'expensive' : 'cheap'"></span>. | |
<!-- function call and comparison --> | |
<button data-bind="enable: parseAreaCode(cellphoneNumber()) != '555'">...</button> | |
<!-- function expression --> |
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
<!-- variable (usually a property of the current view model --> | |
<div data-bind="visible: shouldShowMessage">...</div> | |
<!-- comparison and conditional --> | |
The item is <span data-bind="text: price() > 50 ? 'expensive' : 'cheap'"></span>. | |
<!-- function call and comparison --> | |
<button data-bind="enable: parseAreaCode(cellphoneNumber()) != '555'">...</button> | |
<!-- function expression --> |
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
<!-- variable (usually a property of the current view model --> | |
<div data-bind="visible: shouldShowMessage">...</div> | |
<!-- comparison and conditional --> | |
The item is <span data-bind="text: price() > 50 ? 'expensive' : 'cheap'"></span>. | |
<!-- function call and comparison --> | |
<button data-bind="enable: parseAreaCode(cellphoneNumber()) != '555'">...</button> | |
<!-- function expression --> |
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
<!-- variable (usually a property of the current view model --> | |
<div data-bind="visible: shouldShowMessage">...</div> | |
<!-- comparison and conditional --> | |
The item is <span data-bind="text: price() > 50 ? 'expensive' : 'cheap'"></span>. | |
<!-- function call and comparison --> | |
<button data-bind="enable: parseAreaCode(cellphoneNumber()) != '555'">...</button> | |
<!-- function expression --> |
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 OneOffThreadPool(threading.Thread): | |
def __init__(self, max_concurrent_threads=10): | |
threading.Thread.__init__(self) | |
self.threads = [] | |
self.threads_running = [] | |
self.thread_count = 0 | |
self.max_concurrent_threads = max_concurrent_threads | |
self.log = logging.getLogger(name="OneOffThreadPool") | |
self.log.setLevel(logging.INFO) |
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
constructor(props, context) { | |
super(props, context); | |
// Copied from http://codepen.io/desandro/pen/nFrte | |
this.filterFns = { | |
// show if number is greater than 50 | |
numberGreaterThan50: function () { | |
var number = $(this).find('.number').text(); | |
return parseInt( number, 10 ) > 50; | |
}, |
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
shouldComponentUpdate(nextProps, nextState) { | |
return !shallowEqual(this.props, nextProps) || !shallowEqual(this.state, nextState); | |
} |
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"; | |
import shallowEqual from "react-pure-render/shallowEqual" | |
// Flux | |
import connectToStores from 'alt/utils/connectToStores'; | |
import FilterSortActions from '../flux/actions/FilterSortActions'; | |
import FilterSortStore from '../flux/stores/FilterSortStore'; | |
@connectToStores | |
export default class IsotopeResponseRenderer extends React.Component { |
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
componentWillReceiveProps(nextProps) { | |
if (nextProps.filter && !_.isEqual(nextProps.filter, this.props.filter)) { | |
this.iso.arrange({ filter: this.filterFns[nextProps.filter] || nextProps.filter }); | |
} | |
if (nextProps.sort != null) { | |
this.iso.arrange({sortBy: nextProps.sort}); | |
} | |
} |
OlderNewer