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
| // function deepEqual(a, b) { | |
| // if ((typeof a === 'object' && typeof a !== null) && (typeof b === 'object' && typeof b !== null)) { | |
| // if (Object.getOwnPropertyNames(a).length === Object.getOwnPropertyNames(b).length) { | |
| // for (const propA in a) { | |
| // console.log('First loop:' + a[propA]); | |
| // for (const propB in b) { | |
| // // return deepEqual(propA, propB); | |
| // console.log('Second loop:' + b[propB]); | |
| // } |
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
| function arrayToList(array) { | |
| let list = null; | |
| for (let i = array.length - 1; i >= 0; i--) { | |
| list = { value: array[i], rest: list }; | |
| } | |
| return list; | |
| } | |
| function listToArray(list) { | |
| let 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
| function reverseArray(array) { | |
| let result = []; | |
| for (let i = array.length - 1; i >= 0; i--) { | |
| result.push(array[i]); | |
| } | |
| return result; | |
| } | |
| function reverseArrayInPlace(array) { | |
| for (let i = 0; i < Math.floor(array.length / 2); i++) { |
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
| function range(start, end, step) { | |
| let result = []; | |
| if (step === undefined && start < end) { | |
| step = 1 | |
| } else if (step === undefined && start > end) { | |
| step = -1; | |
| } | |
| if (step < 0) { | |
| for (let i = start; i>= end; i += step) { | |
| result.push(i); |
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
| /* Original is in LESS and can be found here: https://gist.github.com/gefangenimnetz/3ef3e18364edf105c5af */ | |
| @mixin material-shadow($level:1){ | |
| @if $level == 1 { | |
| box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); | |
| } | |
| @else if $level == 2 { | |
| box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23); | |
| } |
NewerOlder