This file contains 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 lang="en"> | |
<head> | |
<title></title> | |
<style id="jsbin-css"> | |
#container { | |
width: 100%; | |
margin: 0 auto; | |
padding: 20px; | |
font-size: 12px; |
This file contains 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 braces = '{()[()]}'; | |
// var braces = '{()()]}'; | |
// var braces = '('; | |
(function matchingBraces() { | |
if (braces.length === 1) return console.log(false); | |
if (!braces) return console.log(true); | |
var leftBraces = ['{', '(', '[']; | |
var rightBraces = ['}', ')', ']']; |
This file contains 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> | |
<style> | |
.red { | |
background-color: #FF0000; | |
} | |
.yellow { | |
background-color: #FFFF00; |
This file contains 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> | |
<style> | |
.colors, #preview { | |
height: 50px; | |
width: 50px; | |
} | |
.colors:hover { | |
cursor: pointer; |
This file contains 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
function swap (array, a, b) { | |
var temp = array[a] | |
array[b] = (array[a] = array[b], temp) | |
} | |
function makeSortedArray(x, y) { | |
var sorted = [] | |
for (var i = x; i < y; ++i) sorted.push(i) | |
return sorted | |
} |
This file contains 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
//reverseVowels | |
//"whiteboard" | |
//"whatobeird" | |
const VOWELS = ['a','e','i','o','u']; | |
function isVowel(char) { | |
return VOWELS.indexOf(char) >= 0; | |
} |
This file contains 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
// Francesca | |
// REVERSE A STRING | |
const assert = require('assert'); | |
function reverse(str) { | |
let output = ''; | |
This file contains 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 TinyColor = require('tinycolor2'); | |
var NEUTRALS = [ | |
['BLACK', 'black', -0.01, .11], | |
['NEARBLACK', 'near black', .11, .2], | |
['GREY', 'grey', 0.2, 0.95], | |
['NEARWHITE', 'near white', 0.95, .99], | |
['WHITE', 'white', .99, 1] | |
]; |
This file contains 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
function getInput() { | |
return [ | |
['name', 'tags'], | |
['john',' hungry,likes_pizza'], | |
['maggie', 'thirsty, productmanager,likes_pizza'], | |
['sally', 'hungry,thirsty, somethingelse'], | |
['tim', 'productmanager'] | |
]; | |
} |
This file contains 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
/** | |
* Resolve an arithmetic equation. | |
* | |
* Ex. '1+3*4/22^4-11' | |
* | |
* @param {String} equation - string representation of arithmetic equation | |
* @return {Number} - resolved number | |
*/ | |
/** |
OlderNewer