Skip to content

Instantly share code, notes, and snippets.

@CooperAtive
CooperAtive / Card.js
Created February 12, 2014 21:56
Object Testing
exports.Card = function(suit, rank) {
function contructor() {};
constructor.prototype.getRank = function() { return rank; };
constructor.prototype.getSuit = function() { return suit; };
return new constructor();
};
@CooperAtive
CooperAtive / gist:9515596
Created March 12, 2014 20:26
type error fix
sass: {
dist: {
files: {'build/css/styles.css': 'assets/scss/styles.scss'}
},
dev: {
options: {
includePaths: {
options: {
'includePaths': ['public/scss/'],
}
@CooperAtive
CooperAtive / gist:9544469
Last active August 29, 2015 13:57
List Reversal
var list =
{ head: 1,
tail: { head: 2,
tail: { head: 3,
tail: { head: 4,
tail: { head: 5,
tail: null
}
}
}
@CooperAtive
CooperAtive / LinkedList.js
Created March 15, 2014 18:47
Linked List Class
function LinkedList(){
var head = {};
function constructor() { }
constructor.prototype.push = function(element) {
if(this.head === null){//if the list is empty
this.head.value = element; //set the heads value
this.head.next = null;
@CooperAtive
CooperAtive / BST.js
Created March 17, 2014 01:50
BST, insert, insert from sorted array, rangeSeach
"use strict";
/*jshint -W055 */
/*jshint -W098 */
/*
var BST = function BST(){
var root;
function constructor(){
this.root = {};