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
/** | |
* Redux | |
* - getState() | |
* - subscribe() | |
* - dispatch() -> ui -> state | |
* - combineReducer | |
* | |
* | |
* - replaceReducer | |
* - injectReducer |
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 parseTimeString(str) { | |
return parseFloat(str.replace(":", ".")) | |
} | |
function hasConflict(firstTime, secondTime) { | |
const firstTimeStart = parseTimeString(firstTime.start) | |
const firstTimeEnd = parseTimeString(firstTime.end) | |
const secondTimeStart = parseTimeString(secondTime.start) | |
const secondTimeEnd = parseTimeString(secondTime.end) | |
if((firstTimeStart <= secondTimeEnd) && (secondTimeStart <= firstTimeEnd)) { |
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
/** | |
* The Maybe type encapsulates an optional value. | |
*/ | |
export class Maybe<T> { | |
/** Create an empty value. */ | |
static nothing<T>(): Maybe<T> { | |
return new Maybe<T>(undefined); | |
} | |
/** Create a non-empty value. */ |
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
// Find theoretical sum of the consecutive numbers using a variation of Gauss Sum. | |
// Formula: [(N * (N + 1)) / 2] - [(M * (M - 1)) / 2]; | |
// N is the upper bound and M is the lower bound | |
function missingNumber(n) { | |
let upperBound = 0; | |
let lowerBound = 99999999; | |
let sum = 0; | |
for (let i = 0; i < n.length; 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
@font-face { | |
font-family: 'Operator Mono SSm'; | |
src: url(data:application/x-font-woff;base64,d09GRgABAAAAAGpyABIAAAAAytgAAQAAAABoTAAAAiYAAAaTAAAAAAAAAABHREVGAABnkAAAAB0AAAAeACgA5UdQT1MAAGewAAAAQAAAAFgsnhyBR1NVQgAAZ/AAAABbAAAAhOs/LbZPUy8yAAACCAAAAFcAAABgWBrmPWNtYXAAAAO8AAACcQAAA2iGH4kRY3Z0IAAACIAAAABkAAAAZBmhB5pmcGdtAAAGMAAAAQIAAAFzBlmcN2dhc3AAAGeEAAAADAAAAAwADwAaZ2x5ZgAACqQAAFZbAACtACBUat1oZG14AAADtAAAAAgAAAAIAAAA5GhlYWQAAAGUAAAAMwAAADYHchYnaGhlYQAAAcgAAAAeAAAAJAZuAsFobXR4AAACYAAAAVEAAANiAJlRdmxvY2EAAAjkAAABwAAAAcAXX0J0bWF4cAAAAegAAAAgAAAAIAMPBGtuYW1lAABhAAAABIkAAAvHAxl5pXBvc3QAAGWMAAAB9wAAApzNbPx+cHJlcAAABzQAAAFKAAAB98jebkJ42mNgZGBgYPQ5c3mdAkc8v81XBnnmF0ARhku3Dt2B06z/zjK1MH8EcjkYmECiALPzD1UAeNpjYGRgYD7w34JBg2kbAxAwtTAwMqCCSwBdKgQ1AAAAAQAAAN8CEAAfAEcABAABAAAAAAAKAAACAAISAAIAAXjaY2BmKmR0ZWBlYGFqZmr+f5dhE4hmcGGMY/BhzGVgYGJg4GQAgwUMDPYCDAxRDFDgoeacD6R4H3IzK/y3YDjBfIDhA5DfDZJjUmDaAKQUGJgAC0sPiAB42m3SvUtCYRTH8XMvhIND1NTS2pBFVmREUEFJg4tKSRkhFmYUQdrLkIQQNDUEZrNrm1tLq/9EU1uLQQm193vqG8TlKh/OfXleznPO9Uesz/j5lR9f |
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 findDifferentSugarCube(boxes) { | |
const selectBoxesOfCubes = boxes.reduce((acc, current, index) => { | |
acc.push(current.slice(0, index + 1)); | |
return acc; | |
}, []); | |
let weight = 0; | |
let no = 0; | |
for (let i = 0; i < selectBoxesOfCubes.length; 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
function redGreenBlue(r, g, b) { | |
const leftArray = [] | |
const createdGroupsNo = []; | |
function createGroup (column, type){ | |
if (column % 3 <= 2) { | |
if (column >= 3) { | |
column -= 3; | |
type && createdGroupsNo.push(Array(3).fill(type)); |
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
version: "3.7" | |
services: | |
# Zookeeper configuration | |
zookeeper-server: | |
image: "bitnami/zookeeper:latest" | |
networks: | |
- kafka | |
- internal | |
ports: |
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 flatten(arr: any[]): any[] { | |
return arr.reduce((acc, curr) =>{ | |
if(Array.isArray(curr)) { | |
acc = acc.concat(flatten(curr)); | |
}else{ | |
acc = acc.concat(curr); | |
} | |
return acc; | |
}, []) |