🔥 Blazing fast builds
😇 CommonJS bundle
🌲 .mjs
bundle
✨ .d.ts
bundle + type-checking
🧐 Source maps
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
#!/usr/bin/env python | |
import math | |
# Function: numberFromWord | |
# - wordString: a String representative of the word | |
# Returns: | |
# - number: an Integer representative of the screen based on map | |
def numberFromWord(wordStr): | |
phoneMap = {"a": 2, "b": 2, "c": 2, |
useViewportScroll
is a great way to create a parallax effect as the page scrolls. In some cases however, we only want to scroll when an element is in the viewport area.
So for example, if we have a "landscape" scene, and want to animate the Sun object only when it's in view, we start with our useViewportScroll
implementation:
function Sun(props) {
const { scrollY, scrollYProgress } = useViewportScroll();
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
palindromeGif() { | |
if [[ -n "$1" ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
if [[ $2 != '--big' ]]; then | |
a=$(ls out-static* | wc -l) | |
for p in $(ls -r out-static*); | |
do | |
out=$(printf "out-static-%05d.png" $a) | |
let "a++" |
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
// Implementation in ES6 | |
function pagination(c, m) { | |
var current = c, | |
last = m, | |
delta = 2, | |
left = current - delta, | |
right = current + delta + 1, | |
range = [], | |
rangeWithDots = [], | |
l; |