These are chat archives for codefellows/sea-b15-javascript

22nd
May 2014
Ivan Storck
@ivanoats
May 22 2014 03:51
can I link to a channel? #codefellows

codefellows/CodeFellows

not markdown...
/join #codefellows/CodeFellows
codefellows/CodeFellows
nope
ah
so we now have a “general” room for all classes and alumni
Hailey L. Petway
@hlpetway
May 22 2014 03:53
Cool!
Dale Corns
@dcorns
May 22 2014 03:53
Sweet!
Ivan Storck
@ivanoats
May 22 2014 04:16
cfbot ping
cfbot ping
@ChelseaLura you have to join https://gitter.im/codefellows/CodeFellows because a pug bomb is about to go off!
cfbot ping
Dale Corns
@dcorns
May 22 2014 04:21
you spammer
Ivan Storck
@ivanoats
May 22 2014 04:22
sorry, just getting skynet the bots working
Hailey L. Petway
@hlpetway
May 22 2014 04:22
hahah
Dale Corns
@dcorns
May 22 2014 04:23
yes, it looks fun, will it connect rooms for everyone or just you?
@kevinmstephens and then in .bashrc put alias git=hub
Hailey L. Petway
@hlpetway
May 22 2014 19:10
@ivanoats persistance pays off! http://hailey-notes-app.herokuapp.com/
Chelsea Lura
@ChelseaLura
May 22 2014 19:14
"Aren't I fabulous?!" <- fabulous indeed!
cfbot animate me tyler morgan
Ivan Storck
@ivanoats
May 22 2014 20:43
gitlog='git log --graph --pretty=format:'\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-commit --date=relative'
gitlog='git log --graph --pretty=format:'\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-commit --date=relative’
Ivan Storck
@ivanoats
May 22 2014 20:53
codefellows/javascript-b15-notes.git
Ivan Storck
@ivanoats
May 22 2014 21:23
ivanoats/notes#3
Ivan Storck
@ivanoats
May 22 2014 21:35
npm install grunt-shell-spawn —save-dev
ps aux | grep mongo
npm install hbsfy --save-dev
Stephen Boles
@stephenboles
May 22 2014 21:56
“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.”
  • Martin Golding
Ivan Storck
@ivanoats
May 22 2014 22:12
var $ = require('jquery');
var Backbone = require('backbone');
var _ = require('underscore');
Backbone.$ = $;

var Note = require('./models/note');
var NoteView = require('./modelViews/note');

$(function(){ 
  var note = new Note({noteBody: "rainbow dash is awesome"});
  note.save();
  var noteView = new NoteView({model: note});
  $('#notes').append(noteView.$el);
});
<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>jQuery Browserify Backbone Demo</title>
</head>
<body>
  <section id="notes"></section>
  <script src="client.js" charset="utf-8"></script>
</body>
</html>
var Backbone = require('backbone');
var $ = require('jquery');
Backbone.$ = $;
var Note = require('../models/note');

module.exports = Backbone.Collection.extend({
  model: Note,
  url: '/api/v1/notes'
});
Ivan Storck
@ivanoats
May 22 2014 22:20
var $ = require('jquery');
var Backbone = require('backbone');
var _ = require('underscore');
Backbone.$ = $;

var Note = require('./models/note');
var NoteView = require('./modelViews/note');
var NoteCollection = require('./collections/noteCollection');

$(function(){ 
  var collection = new NoteCollection();
  collection.fetch({},{
    success: function() {
      console.dir(this);
    }
  });
});
(app.js)
Josh Cunningham
@joshcanhelp
May 22 2014 22:27
/* globals require */

var Backbone = require('backbone');
var _ = require('underscore');
var $ = require('jquery');
Backbone.$ = $;

var Note = require('./models/note');
var NoteView = require('./modelViews/noteView');
var NoteCollection = require('./collections/noteCollection');

$(function() {

    var noteCollection = new NoteCollection();
    noteCollection.fetch({
        success: function (collection, response, options) {
            console.dir(collection);
        }
    });

//    // Make a new note and save it
//    var note = new Note({body: 'Here is a shiny new note'});
//    note.save();
//
//    // Note note view
//    var noteView = new NoteView({model: note});
//    $('#notes_list').append(noteView.$el);

});
Ivan Storck
@ivanoats
May 22 2014 22:28

our app.js : ```javascript
var $ = require('jquery');
var Backbone = require('backbone');
var _ = require('underscore');
Backbone.$ = $;

var Note = require('./models/note');
var NoteView = require('./modelViews/note');
var NoteCollection = require('./collections/noteCollection');

$(function(){
var collection = new NoteCollection();
collection.fetch({
success: function(notes, res, options) {
console.dir(notes);
}
});
});
```

var $ = require('jquery');
var Backbone = require('backbone');
var _ = require('underscore');
Backbone.$ = $;

var Note = require('./models/note');
var NoteView = require('./modelViews/note');
var NoteCollection = require('./collections/noteCollection');

$(function(){ 
  var collection = new NoteCollection();
  collection.fetch({
    success: function(notes, res, options) {
      console.dir(notes);
    }
  });
});
Ivan Storck
@ivanoats
May 22 2014 22:34
noteCollectionView.js
```
var Backbone = require('backbone');
var $ = require('jquery');
var NoteView = require('../modelViews/note');
Backbone.$ = $;

module.exports = Backbone.View.extend({
  className: 'notes',

  initialize: function() {
    this.collection.on('add', this.addNote, this);
    this.collection.on('reset', this.addAll, this);
  },

  addNote: function(note) {
    var noteView = new NoteView({model: note});
    this.$el.append(noteView.el);
  },

  addAll: function() {
    this.collection.forEach(this.addNote);
  },

  render: function() {
    this.addAll();
  }

});
Ivan Storck
@ivanoats
May 22 2014 22:54
var $ = require('jquery');
var Backbone = require('backbone');
var _ = require('underscore');
Backbone.$ = $;

var Note = require('./models/note');
var NoteView = require('./modelViews/note');
var NoteCollection = require('./collections/noteCollection');
var NoteCollectionView = require('./collectionViews/noteCollectionView');

$(function(){ 
  var noteCollection = new NoteCollection();
  var noteCollectionView = new NoteCollectionView({collection: noteCollection});
  noteCollection.fetch({
    success: function() {
      $('#notes').html(noteCollectionView.$el);
    }
  });
});
app.js