Skip to content

Instantly share code, notes, and snippets.

let forecasts = new ForecastCollection();
var Store = _.extend({}, Backbone.Events, {
initialize() {
this.listenTo(forecasts, 'add remove change', () => this.trigger('change'));
},
getForecasts() {
return forecasts.toJSON();
},
/*
* Gulp plugins
*/
var gulp = require('gulp');
var autoprefixer = require('gulp-autoprefixer');
var babel = require('gulp-babel');
var browserSync = require('browser-sync');
var cache = require('gulp-cache');
var concat = require('gulp-concat');
// -> Define an object called 'Robot'
// -> Define a method called 'new' in Robot
// -> When Robot.new is called it should return a new object with Robot as its prototype
// e.g. var robby = Robot.new();
// Robot should be the prototype of robby
var Robot = {
new: function() {
return Object.create(this);
}
var Bookmark = Backbone.Model.extend({
idAttribute: '_id',
defaults: function(){
return {
url: '',
tags: []
};
}
});
// Declare a variable that will later store the selected character and enemy
var selectedCharacter;
var selectedEnemy;
// Define a constructor
window.Character = function(params) {
_.extend(this, params);
};
// Give all characters an attack function
var Item = Backbone.Model.extend({
defaults: {
name: '',
price: ''
}
});
var ItemCollection = Backbone.Collection.extend({
model: Item,
url: "https://api.parse.com/1/classes/Item",
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div id="app-container"></div>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div id="app-container"></div>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div id="app-container"></div>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div id="app-container"></div>