So you are taking on the adventure of creating your first real hackathon experiment, a blood pressure monitor. You have decided to use Meteor JS for you're contribution to the system, the web ui, great choice! I know you will do well. Here are some quick tips and thoughts in order to help bring your blood pressure down. Nothing in this tip list is rock solid, meaning you don't need to follow every bit down to the end. You can write your application how ever you want, just breath, think about what your objective is and let the code flow.
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
/** | |
Problem Statement | |
Javascript does not have a built in function that removes objects {} from an array with negitive conditions i.e. != | |
*/ | |
/* Example of problem */ | |
const myArray = [ { a: 'b', 'b': 'c' }, { a: 'b', 'b': 'd' }]; | |
const filter = { a: 'b', b: 'c'} |
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 ProxyStore = (values={}, options={}) => new Proxy( | |
{ | |
__registry: {}, | |
subscribe: function(key, fn) { | |
this.__registry[key] = [...(this.__registry[key] || []), fn]; | |
}, | |
unsubscribe: function(key, fn) { | |
this.__registry[key] = this.__registry[key].filter(fn); | |
}, | |
...values, |
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
START CAPTURE 0 undefined took NaN | |
| (#1) Profiling: ProjectContext prepareProjectForBuild | |
START 1 preparing project | |
START 2 reading project metadata | |
DONE 2 reading project metadata took 9 | |
START CAPTURE 2 undefined took NaN | |
START 3 scanning local packages | |
START 4 looking for packages | |
DONE 4 looking for packages took 13 | |
START 4 initializing packages |
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
_.mixin({ | |
get: function (obj, key) { | |
var type = typeof key; | |
if (type == 'string' || type == "number") { | |
key = ("" + key).replace(/\[(.*?)\]/,/\[(.*?)\]/, function (m, key) { //handle case where [1] may occur | |
return '.' + key.replace(/["']/g,/["']/g, ""); //strip quotes | |
}).split('.'); | |
} | |
for (var i = 0, l = key.length; i < l; i++) { |
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
Dropdown = React.createClass({ | |
componentDidMount() { | |
document.addEventListener('click', this.outSideClick, false); | |
}, | |
componentWillUnmount: function () { | |
document.removeEventListener('click', this.outSideClick, false); | |
}, | |
outSideClick (event) { | |
if (ReactDOM.findDOMNode(this).contains(event.target)) { | |
return; |
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
Tabs = React.createClass({ | |
/** | |
* Sets the activeTabIndex state | |
* @index the index you would like to set to active | |
*/ | |
setActiveTab (index) { | |
this.setState({ | |
activeTabIndex : index | |
}); | |
}, |
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
Table = React.createClass({ | |
mixins : [React.addons.PureRenderMixin], | |
/** | |
* Sets the components key and dir state | |
* @event the synthetic event from ReactJS | |
*/ | |
setSortKey (event) { | |
//Get the key from the target element | |
let key = event.target.getAttribute('data-sortkey'); | |
//Set the state |
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
Tabs = React.createClass({ | |
tabClick (tab) { | |
this.setState({ | |
activeTabIndex : tab.props.tabIndex | |
}); | |
}, | |
getInitialState () { | |
return { | |
activeTabIndex : 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
Modal = React.createClass({ | |
render () { | |
return ( | |
<div className="md-modal md-effect-1" id="modal-1"> | |
<div className="md-content"> | |
<h3>{this.props.title}</h3> | |
<div className="md-body"> | |
{this.props.content} | |
<i className="md-close close ion ion-close"></i> | |
</div> |
NewerOlder