View scroll-indicator-3.jsx
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)}%`, |
View scroll-indicator-2.jsx
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( |
View scroll-indicator-1.jsx
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) => { |
View android.wait-for-launcher.sh
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 |
View App.lazy.js
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>}> |
View App.eager.js
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 /> |
View VeryBigJokesList.js
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 ( |
View mac-dev-folder-issues.sh
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 |
View index.html
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