Skip to content

Instantly share code, notes, and snippets.

View reime005's full-sized avatar
ℹ️

Marius Reimer reime005

ℹ️
View GitHub Profile
@reime005
reime005 / husky.config.js
Last active February 11, 2021 03:25
Husky Configuration File
const runYarnLock = 'yarn install --frozen-lockfile';
module.exports = {
hooks: {
'post-checkout': `if [[ $HUSKY_GIT_PARAMS =~ 1$ ]]; then ${runYarnLock}; fi`,
'post-merge': runYarnLock,
'post-rebase': 'yarn install',
'pre-commit': 'yarn test && yarn lint-staged'
}
};
@reime005
reime005 / android.yml
Created November 24, 2019 15:15
React Native Github Actions Android E2E Detox
name: Android
on: [push, pull_request]
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout project
<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