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
| /** | |
| * TODO: Forgot to check constraints | |
| * https://leetcode.com/problems/maximize-happiness-of-selected-children/ | |
| * @param {number[]} happiness | |
| * @param {number} k | |
| * @return {number} | |
| */ | |
| var maximumHappinessSum = function(happiness, k) { | |
| let sorted = happiness.sort((a, b) => (a-b)); // sort for ease | |
| let total = 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
| // TODO: See design.md | |
| // For ideas: https://dev.to/siddharthshyniben/implementing-reactivity-from-scratch-51op or github.com/facebook/react | |
| // const [string, onStringChange] = reactiveData('Sam'); |
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
| // TODO: Just moved cacheofcaches from global to private var in IIFE. Need to change .bind() with cacheofcaches. | |
| /** | |
| * TODO: Rewrite this comment | |
| * Returns a memoized version of the provided function. | |
| * Old description: Cache the input/output of a pure function | |
| */ | |
| const memo = (function() { | |
| /* Maps functions to their caches (which are also Maps). */ | |
| const cacheofcaches = new Map(); |
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
| const phoneRegex = /^1?\s*((\({1}(\d(\s?)){3}\){1})|(\d(\s?)){3})(-|\s?)(\d(\s?)){3}-?(\d(\s?)){4}$/; | |
| function telephoneCheck(str) { | |
| return !!str.match(phoneRegex); | |
| } | |
| telephoneCheck("555-555-5555"); |
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
| /* | |
| TODO: | |
| - Is this needed for each post or only forms? --> xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); | |
| - Handle timeout. Consider using setTimeout() and/or xhr.ontimeout event. | |
| - Add support for username, password, json, jsonp, 'PUT' requests, | |
| */ | |
| /** | |
| * | |
| @param opts - [OPTIONAL] - Settings for the XHR request. | |
| async (default: true) - Asynchronous or sycnhronous request. |
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
| <link href="http://fonts.googleapis.com/css?family=Raleway:200,100,400" rel="stylesheet" type="text/css" /> | |
| <h1>This website will be | |
| <span | |
| class="txt-rotate" | |
| data-period="1500" | |
| data-rotate='[ "cool.", "sexy.", "awesome.", "pretty.", "fun!" ]'></span> | |
| </h1> | |
| <h2>Unfortunately, it's still being made.</br>Please try again later. </h2> | |
| <h4> - Deep Duggal (the developer)</h4> |
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
| %nav | |
| %a{:href=>"#"} Button A | |
| %a{:href=>"#"} Button B | |
| %a{:href=>"#"} Button C | |
| %a{:href=>"#"} Button D | |
| .main | |
| %h2 Normal Website Template | |
| %h4 By Deep Duggal - deep@deepduggal.me |