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
// Author: Josh Comeau | |
// https://courses.joshwcomeau.com/css-for-js | |
// Replace “.the-sticky-child” for a CSS selector | |
// that matches the sticky-position element: | |
const selector = '.the-sticky-child'; | |
function findCulprits(elem) { | |
if (!elem) { | |
throw new Error( |
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
// Author: Josh Comeau | |
// https://courses.joshwcomeau.com/css-for-js/ | |
// Helps developers finding the parent element that break the fixed position | |
// Replace “.the-fixed-child” for a CSS selector | |
// that matches the fixed-position element: | |
const selector = '.the-fixed-child'; |
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 FloydCycleModel: | |
def __init__(self, cycleLength: int, fasterSpeed: int, slowerSpeed: int) -> None: | |
self.CycleLength = cycleLength | |
self.FasterSpeed = fasterSpeed | |
self.SlowerSpeed = slowerSpeed | |
def calcIterations(self, n: int) -> int: | |
return n * self.CycleLength / (self.FasterSpeed - self.SlowerSpeed) | |
def argmin(self) -> int: |