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
<View | |
style={{ | |
height: 100, | |
... | |
}} | |
> | |
<View | |
style={{ | |
position: "absolute", | |
top: `${Number(scrollPerc || 0).toFixed(0)}%`, |
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
const scrollElementHeightPercent = 45; | |
export default Example = () => { | |
... | |
const [scrollViewHeight, setScrollViewHeight] = React.useState(0); | |
const scrollPerc = (contentOffset.y / (contentSize - scrollViewHeight)) | |
* (100 - scrollElementHeightPercent); | |
return( |
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
export default Example = () => { | |
const [contentOffset, setContentOffset] = React.useState({ x: 0, y: 0 }); | |
const [contentSize, setContentSize] = React.useState(0); | |
return( | |
<ScrollView | |
onScroll={e => { | |
setContentOffset(e.nativeEvent.contentOffset); | |
}} | |
onContentSizeChange={(_, height) => { |
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/bash | |
echo "" | |
echo "[Waiting for launcher to start]" | |
LAUNCHER_READY= | |
while [[ -z ${LAUNCHER_READY} ]]; do | |
UI_FOCUS=`adb shell dumpsys window windows 2>/dev/null | grep -i mCurrentFocus` | |
echo "(DEBUG) Current focus: ${UI_FOCUS}" | |
case $UI_FOCUS in |
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
import * as React from 'react'; | |
const VeryBigJokesList = React.lazy(() => import('./VeryBigJokesList')); | |
function App() { | |
return ( | |
<div className="App"> | |
<header className="App-header"> | |
<div style={{ maxWidth: 600 }}> | |
<React.Suspense fallback={<p>Loading list...</p>}> |
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
import * as React from 'react'; | |
import VeryBigJokesList from './VeryBigJokesList'; | |
function App() { | |
return ( | |
<div className="App"> | |
<header className="App-header"> | |
<div style={{ maxWidth: 600 }}> | |
<VeryBigJokesList /> |
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
import React from 'react' | |
import preDefinedJokes from './preDefinedJokes.json' | |
const VeryBigJokesList = ({ jokes = preDefinedJokes }) => { | |
if (!Array.isArray(jokes)) { | |
return <p>No jokes found.</p> | |
} | |
return ( |
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
# fix vscode issue that causes a 100% cpu usage (tsserver) | |
~/Library/Caches/typescript | |
# ios / xcode | |
~/Library/Developer/Xcode/DerivedData/* | |
~/Library/Developer/CoreSimulator/Caches/* | |
# android | |
~/.gradle/caches |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<link href="https://fonts.googleapis.com/css2?family=Baloo+Bhaina+2:wght@600&display=swap" rel="stylesheet"> | |
<style type="text/css"> | |
body { | |
font-family: 'Baloo Bhaina 2', cursive; | |
background-color: #fffdf8; | |
} | |
.highlighted-text { |
NewerOlder