This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node { | |
constructor(val) { | |
this.val = val; | |
this.left = null; | |
this.right = null; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// calendar | |
class Appointment { | |
constructor(dateStamp, description, id) { | |
this.id = id; | |
this.date = dateStamp || new Date(); | |
this.description = description || 'New Appointment'; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// string reverse using recursion | |
var str = 'abcdefg'; | |
function reverse(original, reversed) { | |
if (!reversed) { | |
return reverse(original, [original.charAt(original.length - 1)]); | |
} else { | |
var len = reversed.length; | |
reversed.push(original.charAt(original.length - len - 1)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// palindrome | |
var words = ['otto', 'hannah', 'schlumberger']; | |
var test = function(words) { | |
for (var i = 0; i < words.length; i++) { | |
var result = palindrome(words[i]); | |
console.log(result); | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
function justify(str, lineLength) { | |
if (str.length >= lineLength) { | |
throw 'Line length is equal to or exceeds justification length'; | |
} | |
function genArrayOfSpaces(len) { | |
var arr = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var graph = { | |
nodes: | |
[{ | |
userId: 'chill', | |
city: 'Sonoma' }, | |
{ | |
userId: 'sjobs', | |
city: 'Mountain View' }, | |
{ | |
userId: 'bgates', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>MJ Test</title> | |
<style> | |
.passed { color: green; } | |
.failed { color: red; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Automata(): | |
'Represents a cellular automata with configurable params:' | |
' - number of columns, defaults to 64' | |
' - number of iterations, defaults to 32' | |
' - true symbol, defaults to *' | |
' - false symbol, defaults to -' | |
entries = [] | |
rows = 0 | |
cur_row = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.container { | |
/* removed width here */ | |
border: 1px solid black; | |
height:80px; | |
overflow-x:auto; | |
overflow-y:hidden; /* turns off y-scrollbar */ | |
display:block; | |
} | |
.image-container { | |
background: blue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h1, h2, h3, h4, h5, h6 { | |
font-weight: normal; | |
} | |
form, input, button { | |
border: none; | |
margin: 0; | |
padding: 0; | |
} |
NewerOlder