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 move(el, distance, duration) { | |
let startTime; | |
function recur() { | |
window.requestAnimationFrame((time) => { | |
if (startTime === undefined) { | |
startTime = time; | |
} | |
const elapsed = time - startTime; | |
const fraction = elapsed / duration; | |
const dx = Math.min(distance, distance * fraction); |
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
#!/bin/sh | |
# Calculates a metric of how many `any`'s are there compared to line count for TypeScript codebase (in percents) | |
# Basically we count all `any` occurences, then count all lines in the codebase, and lastly divide one by another | |
echo "scale = 4; $(find -name "*.ts?" -not -path "./node_modules/*" | xargs grep -o '\bany\b' | wc -l) * 100 / $(find -name "*.ts?" -not -path "./node_modules/*" | xargs wc -l | tail -1 | awk '{print $1}')" | bc |
OlderNewer