Skip to content

Instantly share code, notes, and snippets.

View reime005's full-sized avatar
ℹ️

Marius Reimer reime005

ℹ️
View GitHub Profile
<View
style={{
height: 100,
...
}}
>
<View
style={{
position: "absolute",
top: `${Number(scrollPerc || 0).toFixed(0)}%`,
const scrollElementHeightPercent = 45;
export default Example = () => {
...
const [scrollViewHeight, setScrollViewHeight] = React.useState(0);
const scrollPerc = (contentOffset.y / (contentSize - scrollViewHeight))
* (100 - scrollElementHeightPercent);
return(
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) => {
#!/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
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>}>
import * as React from 'react';
import VeryBigJokesList from './VeryBigJokesList';
function App() {
return (
<div className="App">
<header className="App-header">
<div style={{ maxWidth: 600 }}>
<VeryBigJokesList />
import React from 'react'
import preDefinedJokes from './preDefinedJokes.json'
const VeryBigJokesList = ({ jokes = preDefinedJokes }) => {
if (!Array.isArray(jokes)) {
return <p>No jokes found.</p>
}
return (
# 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
@reime005
reime005 / index.html
Last active April 26, 2020 16:33
CSS Custom Text Highlighting
<!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 {
@reime005
reime005 / README.md
Created November 24, 2019 15:24
Github Actions badge Example (.github/workflows/iOS.yml)

iOS badge example