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
<iframe src="https://app.box.com/embed/s/0dtgl906gz1vsrqp1w6paqxhwuarn1mv?sortColumn=date" width="500" height="400" frameborder="0" allowfullscreen webkitallowfullscreen msallowfullscreen></iframe> |
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
<iframe src="https://amedmarket.app.box.com/embed/s/z5ywvjsia9qpllfj1yaq7gni6398ql6g?sortColumn=date" width="800" height="550" frameborder="0" allowfullscreen webkitallowfullscreen msallowfullscreen></iframe> |
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
# Set color codes for directory and Git branch | |
dir_color='%F{blue}' | |
branch_color='%F{green}' | |
# Set Git branch state color codes | |
uncommitted_color='%F{red}' | |
untracked_color='%F{yellow}' | |
ahead_color='%F{cyan}' | |
behind_color='%F{magenta}' | |
conflicted_color='%F{red}' |
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 debounceFetch (fn, delay, onCancel = () => {}) { | |
let timer = 0, isFetching = false | |
return function (...args) { | |
clearTimeout(timer) | |
if (isFetching) { | |
onCancel() | |
isFetching = false | |
} |
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
// React: How to Correctly Build a Counter/Clock/Timer Component Using Hooks | |
//Taken from: https://overreacted.io/making-setinterval-declarative-with-react-hooks/ | |
import React, { useState, useEffect, useRef } from "react"; | |
import ReactDOM from "react-dom"; | |
function Counter() { | |
const [count, setCount] = useState(0); | |
const savedCallback = useRef(); |
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
class UnionFind { | |
constructor(size) { | |
this.nodes = new Array(size).fill(-1) | |
} | |
find(i) { | |
while(true) { | |
if(i === this.nodes[i]) this.nodes[i] = -1 | |
if(this.nodes[i] < 0) { | |
return i; |
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
//Iterative solution for Leetcode Problem 114. | |
//Currently having out of memory issues on Leetcode, but runs flawlessly on local Node setup | |
var flatten = function(root) { | |
if(root === null) return null; | |
const DOWN = 1; //represents performing a recursive function call | |
const UP = 2; //represents returning from a recursive function call | |
let stack = []; |
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
//Recursive Quicksort using Lomuto's partitioning method | |
function lomutosPartition(array, start, end) { | |
let i = start; | |
let pivot = array[end] | |
for(let j = start; j < end; j++) { | |
if(pivot > array[j]) { | |
[array[j], array[i]] = [array[i], array[j]]; | |
i++; | |
} |
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
/* | |
Given an array of 1's and 0's in the following format: | |
[1, 1, 1, 0, 0] | |
Use binary search to determine how many 1's are in the array. | |
You can assume the 1's will always appear together and at the | |
beginning of the array. | |
*/ | |
function bs(array) { |
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
license: gpl-3.0 |
NewerOlder