Skip to content

Instantly share code, notes, and snippets.

getting things done 💪🏻

Stefan Natter natterstefan

getting things done 💪🏻
View GitHub Profile
natterstefan /
Created March 18, 2020 20:10 — forked from amcvitty/
Configure Password Autofill on a React Native Expo app

Password Autofill on a React Native Expo app

Developing an app to accompany our website, worried that we would lose people in the transition if they couldn't remember their password, we were looking to make our app do Password AutoFill, a feature in iOS.

A talk from WWDC introducing the feature:

It works well, but there were a few bumps in the road making it work for React Native on Expo, so here are some notes to help out.

Apple's docs are here: and they say something like this:

natterstefan / HTMLToReact.tsx
Last active July 5, 2023 08:42
html-react-parser | TypeScript solution
View HTMLToReact.tsx
* Works in Next.js 10.x
import React from 'react'
import parse, {
} from 'html-react-parser'
natterstefan /
Created February 18, 2020 14:47
Jest | Mock useState

Jest - mock useState

When using import React, { useState } from 'react' in your components, this is how you can mock useState with jest.

natterstefan / moveMouse.js
Created April 27, 2023 19:40
JS Utils | Move Mouse Randomly Forever
View moveMouse.js
// function to generate a random number within a range
function getRandomNumber(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
// function to generate a random mouse coordinate within the viewport
function getRandomCoordinate() {
const x = getRandomNumber(0, window.innerWidth);
const y = getRandomNumber(0, window.innerHeight);
return { x, y };
natterstefan /
Last active March 2, 2023 19:43
NODE | macOS fix node-gyp
natterstefan /
Last active January 9, 2023 04:25
Raspberry Pi | Setup gdrive to sync local folder to Google Drive
# gdrive client:
# inspired by
# Create directory ~/backups (must be empty at the beginning)
rm -rf ~/backups && mkdir ~/backups
# upload it the first time into a parent directory
# 1234 => id of the parent directory on google drive
# eg.
natterstefan /
Created May 1, 2019 05:41
Raspberry Pi | Backup and Sync Pi-hole and UniFi data from a Raspberry Pi to Google Drive
# create backup folders (if they do not exist yet)
mkdir -p ~/backups
mkdir -p ~/backups/unifi
mkdir -p ~/backups/pihole
# backup pi-hole
(cd ~/backups/pihole && pihole -a teleporter)
natterstefan /
Last active November 30, 2022 14:57
Typescript | Infere Types from PropTypes
natterstefan /
Last active September 23, 2022 02:42
Storybook | Tailwind in Next.js App with Webpack@5