Skip to content

Instantly share code, notes, and snippets.

View CheezItMan's full-sized avatar

Chris M CheezItMan

View GitHub Profile
// /src/app.js
// Import jQuery
import $ from 'jquery';
import _ from 'underscore';
import Task from './models/task';
import TaskList from './collections/task_list';
var taskData = [{
title: "Create a model",
@CheezItMan
CheezItMan / task.js
Last active May 19, 2017 21:04 — forked from anonymous/app.js
app.js
import Backbone from 'backbone';
var Task = Backbone.Model.extend({
defaults: {
title: '',
completed: false
},
logStatus: function() {
console.log("Title: " + this.get("title"));
console.log("Completed: " + this.get("completed"));
@CheezItMan
CheezItMan / app.js
Last active May 28, 2017 04:12
app.js using Backbone to add, and delete list items (new views yet).
// /src/app.js
// Load Foundation Files
import _settings from './css/_settings.scss';
import foundation from './css/foundation.css';
import css from './css/styles.css';
// Import jQuery & underscore
import $ from 'jquery';
import _ from 'underscore';
import Task from './models/task';
// /src/app.js
// Import jQuery
import $ from 'jquery';
import _ from 'underscore';
import Task from './models/task';
import TaskList from './collections/task_list';
var taskData = [{
title: "Create a model",
import Backbone from 'backbone';
var Task = Backbone.Model.extend({
defaults: {
title: '',
completed: false
},
logStatus: function() {
console.log("Title: " + this.get("title"));
console.log("Completed: " + this.get("completed"));
@CheezItMan
CheezItMan / app.js
Last active May 30, 2017 15:12
Example app.js using a Task model to create several instances.
// /src/app.js
// Import jQuery
import $ from 'jquery';
import _ from 'underscore';
import Task from './models/task';
var my_task = new Task({
title: "Create a model",
completed: true
# Gems we've talked about in class, but which have absolutely nothing to do
# with setting up spec-style testing.
# Included here for convenience.
gem_group :development do
# Improve the error message you get in the browser
gem 'better_errors'
# Use pry for rails console
gem 'pry-rails'
end
# sample_code.rb from POOD Ch 3
# Starter 1 - Heaviliy dependent Gear class
class Gear
attr_reader :chainring, :cog, :rim, :tire
def initialize(chainring, cog, rim, tire)
@chainring = chainring
@cog = cog
@rim = rim
@CheezItMan
CheezItMan / player_spec.js
Last active December 14, 2016 17:05
player.js spec testing file
// spec/player_spec.js
import Player from 'player';
describe('Player', function() {
var player;
beforeEach(function() {
player = new Player({
name: "bob"
// player.js
import Scrabble from 'scrabble';
import Backbone from 'backbone';
const Player = Backbone.Model.extend({
defaults: {
},
initialize: function(options) {
this.name = options.name;