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 PeanutButterJelly extends React.Component { | |
constructor(props){ | |
super(props); | |
this.state = { | |
dummyStateToTriggerUpdate: [] | |
}; | |
this.addToDummyState = this.addToDummyState.bind(this); | |
setTimeout(() => | |
this.addToDummyState(), |
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
https://github.com/webpack/webpack-dev-server/issues/100#issuecomment-283343053 | |
https://github.com/gaearon/react-hot-loader/issues/515 | |
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
{ | |
"name": "online-store", | |
"version": "0.0.0", | |
"license": "MIT", | |
"angular-cli": {}, | |
"scripts": { | |
"ng": "ng", | |
"start": "ng serve", | |
"lint": "tslint \"src/**/*.ts\" --project src/tsconfig.json --type-check && tslint \"e2e/**/*.ts\" --project e2e/tsconfig.json --type-check", | |
"test": "ng test", |
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
var sheet = SpreadsheetApp.getActiveSheet(), | |
rows = sheet.getDataRange(), | |
numRows = rows.getNumRows(), | |
values = rows.getValues(), | |
re = ' at', | |
// Depending on layout and format of spreadsheet, alter these variables as necessary: | |
startTimeCol = 1, | |
enteredExitedColumn = 0, | |
hoursDurationColumn = 3, | |
letterForHoursDurationColumn = "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
// Because the ajax request is asynchronous, cannot assign data from api response to a variable in the success | |
// callback and return it, because the return statement will execute before the success function is completed. | |
// Instead, logic must happen inside of the success callback function. | |
// This can either mean using jQuery to directly display the response: | |
exports.getHumidity = function(city) { | |
$.get(url).then(function(response) { | |
$('.showWeather').text("The humidity in " + city + " is " + response.main.humidity + "%"); | |
}).fail(function(error) { |
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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
selectedSkills: Ember.inject.service(), // <-- service containing an array of objects. | |
selected: Ember.computed.alias('selectedSkills.skills'), // <-- giving 'selected' nickname to this array of objects within service. | |
skillsInCommon: Ember.computed.intersect('selected', 'project.skills'), // <-- returning only the objects present in both the service's array and in 'project.skills' (current model where this component is being called?) | |
}); |
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
//this is the model for an object that has many reviews. reviews each contain a score. the averageScore property below gathers | |
// all reviews, sums all scores from all reviews, and divides by the number of reviews to calculate an average score. | |
import Ember from 'ember'; | |
import DS from 'ember-data'; | |
export default DS.Model.extend({ | |
reviews: DS.hasMany('review', {async: true}), | |
... |
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
//in component | |
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
sortProperties: ['date:desc'], | |
sortedAnswers: Ember.computed.sort('comments', 'sortProperties'), | |
actions: { | |
... | |
} |
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 Home Directory, in the following order: | |
$ brew update | |
$ brew upgrade node | |
$ npm uninstall -g ember-cli | |
$ npm cache clean | |
$ bower cache clean | |
$ npm install -g [email protected] |
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
showMap(foodcarts) { | |
this.set('mapShowing', true) | |
var coordArray = []; | |
var contentArray = []; | |
var markerarray = []; | |
foodcarts.forEach(function(foodcart) { | |
coordArray.push([foodcart.get('latitude'), foodcart.get('longitude')]), | |
contentArray.push([foodcart.get('name'), foodcart.get('website')]) | |
}); |
NewerOlder