Skip to content

Instantly share code, notes, and snippets.

View rainforest-of-code's full-sized avatar

rainforest-of-code

View GitHub Profile
@rainforest-of-code
rainforest-of-code / gist:3845861
Created October 6, 2012 19:29 — forked from prasoonsharma/gist:717903
Data Frame operations in R
# DATA FRAME OPERATIONS IN R
# Create data frame
# A dataset is ~ table (list of vectors)
id <- c(1,2,3)
name <- c("John", "Kirk", "AJ")
age <- c(21,27,18)
employees <- data.frame(ID=id, Name=name, Age=age)
employees
@rainforest-of-code
rainforest-of-code / Ball.js
Created May 31, 2012 16:27
Follow along code for a Jasmine introduction presentation
function Ball() {
var self = this;
var full = false;
self.inflate = function() {
full = true;
};
self.isFull = function() {
@rainforest-of-code
rainforest-of-code / render.js
Created May 31, 2012 16:18 — forked from mxriverlynn/render.js
Help me clean this up
// This is the render method in the `ItemView` in my Backbone.Marionette plugin.
// It's a giant method - far too much happening in this one method, and poor
// use of memory with all of the methods that get re-defined on every use.
//
// It desperately needs to be cleaned up. But I can't do something quite as
// simple as just move the inner functions on to the ItemView itself. There
// are too many methods on the ItemView already.
//
// Suggestions? What are some good patterns to clean this up?
//