Skip to content

Instantly share code, notes, and snippets.

@jonahkirangi
jonahkirangi / mbp-setup.markdown
Created December 14, 2016 05:59 — forked from jasonrhodes/mbp-setup.markdown
Setting up my new MacBook Pro
  • Set up user account
  • Name computer
  • Check trackpad settings
  • Install Google Chrome
  • Install Homebrew http://brew.sh/
  • Brew should auto-install Xcode Developer Tools for you
  • $ brew doctor
  • $ brew install git
  • Download node.js (I prefer the installer over brew) http://nodejs.org/download/
  • npm is now installed, too
@jonahkirangi
jonahkirangi / rangesearchinBST.js
Created April 4, 2014 04:00
Range Search in BST
var option1 = [1,2,3];
var option2 = [1,2,3,4];
var option3 = [1,5,6,22,34,46,48,51,63,69,72,83,95];
var option4 = [];
function arrayToBST(list) {
var middle = Math.floor(list.length/2);
if(list.length < 1) {
return null;
@jonahkirangi
jonahkirangi / sortedarraytobst.js
Created April 3, 2014 07:53
Sorted Array to BST
var option1 = [1,2,3];
var option2 = [1,2,3,4];
var option3 = [1,2,3,4,5];
var option4 = [1];
function arrayToBST(list) {
// Math.floor or Math.ceil (??)
var middle = Math.floor(list.length/2);
if(list.length < 1) {
var list1 = { head: 2, tail: null };
var list2 = { head: 1, tail: null };
function merge(list1,list2) {
// if list1 and list2 are both null
if (list1 === null && list2 === null) {
return "There's nothing here!";
}
// if either list1 or list2 are null
@jonahkirangi
jonahkirangi / iterative_list_reverse.js
Last active August 29, 2015 13:57
Iterative List Reverse
var option1 = { head: 1, tail: { head: 2, tail: { head: 3, tail: { head: 4, tail:
{ head: 5, tail: null } } } } };
var option2 = {head: 1, tail: {head: 2, tail: {head: 3, tail: null}}};
function reverse(l1, l2) {
if( l1 === null ) {
return l2;
} else {
return reverse(l1.tail, {
var expect = require('chai').expect,
Card = require('../lib/card').Card;
describe('when I create a card with a particular suit and rank', function() {
var myCard;
beforeEach(function() {
myCard = new Card('heart', 8);
});
var expect = require('chai').expect,
Card = require('../lib/card').Card;
describe('when I create a card with a particular suit and rank', function() {
var myCard;
beforeEach(function() {
myCard = new Card('heart', 8);
});
@jonahkirangi
jonahkirangi / card.js
Created February 17, 2014 19:49
Simple Object with Testing
var expect = require('chai').expect,
Card = require('../lib/card').Card;
describe('when I create a card with a particular suit and rank', function() {
var myCard;
beforeEach(function() {
myCard = new Card('heart', 8);
});
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
// define the files to lint
all: ['Gruntfile.js', 'test/**/*.js', 'lib/**/*.js'],
// configure JSHint (documented at http://www.jshint.com/docs/)
# Running tests:
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
F
Finished tests in 0.272425s, 3.6707 tests/s, 3.6707 assertions/s.
1) Failure:
As a site visitor I want to be able to sign up for an account so that I can perform actions that require me to be logged in. Feature Test#test_0001_sign up [test/features/auth/sign_up_test.rb:16]:
Expected to include "successfully".