Skip to content

Instantly share code, notes, and snippets.

View OfTheDelmer's full-sized avatar

Delmer OfTheDelmer

View GitHub Profile
_ = require "lodash"
{Model, Collection} = require "backbone"
#Creating a simple todo collection
class Todo extends Model
defaults:
title: "",
completed: false
# Setup Backbone.Model, Backbone.Collection, Backbone.View
{Model, Collection, View} = Backbone
#BASIC APP
###
recall that coffeescript will wrap our app
in a function that prevents us from polluting
the global scope.
We define App as a globally so we can play with it

Get the Gist about me?

var Node = function(data, parent){
this.children = null;
if(data === undefined){
data = null;
}
parent !== undefined?parent.addChild(data):this.data = data;
};
Node.prototype.addChild = function(child){
var newNode;
@OfTheDelmer
OfTheDelmer / trie_fun.js
Last active December 29, 2015 22:59
rough thought of a trie, needs work
var DigitalNode = function(data){
this.ref = null;
data === undefined? this.data = null: this.data = data;
};
var Trie = function(){
this.primes = [2];
@OfTheDelmer
OfTheDelmer / singly_linked_list.rb
Created December 2, 2013 04:08
Playing with an attempt at Singly Linked Lists
class List
attr_accessor :items
def initialize(*args)
@items = digest(args)
end
def insertAfter(item, newItem, items=@items)
if(items.car == item)
items.cdr = Cons.new(newItem, items.cdr)
@OfTheDelmer
OfTheDelmer / hashy_linked_list.rb
Last active December 29, 2015 23:49
mixing hashes with idea of linked lists
####
# first->next list
####
class HashyList
def initialize(*args)
@first=nil
@next=nil
@items = {}
args != [] ? digest(args) : @items[@first] = @next
end
@OfTheDelmer
OfTheDelmer / cs_lecture.md
Last active December 30, 2015 00:19
lecture for CS:DS

CS WEEK: Data Structures

Intro to Linked Lists and Trees

  • What is Computer Science?
    • Types of knowledge
  • Why Data Structures?
    • Background Checkpoint
      • What are some familiar data structures…
      • What are some means of combination…
      • What are some means of abstracting…
###
# Node List
###
class Node
attr_accessor :val, :next
def initialize(val,next=nil)
@val=val
@next=next
end