Skip to content

Instantly share code, notes, and snippets.

View natterstefan's full-sized avatar
🟨
getting things done 💪🏻

Stefan Natter natterstefan

🟨
getting things done 💪🏻
View GitHub Profile
@natterstefan
natterstefan / index.d.ts
Created September 5, 2020 18:27
TypeScript | Declaration Merging
/**
* Why is any so important?
*
* > Non-function members of the interfaces should be unique. If they are not unique,
* they must be of the same type. The compiler will issue an error if the interfaces
* both declare a non-function member of the same name, but of different types.
* @see https://www.typescriptlang.org/docs/handbook/declaration-merging.html#merging-interfaces
*
* Docs
* @see https://www.typescriptlang.org/docs/handbook/declaration-merging.html
@natterstefan
natterstefan / README.md
Last active August 25, 2020 16:25
Alfred 4 | Resolve "Error: Command failed: alfred-link"

Resolve "Error: Command failed: alfred-link"

Specs

  • Alfred 4 with Powerpack
  • macOS 10.15.6
  • node 12.16.0
  • custom preferences folder (e.g. ~/Dropbox)

Expectation

@natterstefan
natterstefan / .bash_profile
Created July 8, 2020 19:07
Enhance your git commands with ASCII Art
# ... other settings in your .bash_profile
# aliases
alias gpu='echo ""; cat ~/push.txt; git push; echo "";'

Netdata

Monitor everything in real time for free with Netdata

Setup

touch netdata.sh
chmod +x netdata.sh
./netdata.sh
@natterstefan
natterstefan / ellipsize.d.ts
Created May 13, 2020 07:01
@types/ellipsize
/**
* custom ellipsize typings - tested with ellipsize@0.1.0
*/
declare module 'ellipsize' {
/**
* @param text text to ellipsize
* @param maxLength of the text before it is ellipsized
* @param options
*/
function ellipsize(
@natterstefan
natterstefan / REAME.md
Last active March 28, 2020 13:19
Make the Web a better Place Collection
@natterstefan
natterstefan / index.tsx
Created March 20, 2020 07:31
React | usescrolldrag hook
import React from 'react'
const App = () => {
const containerRef = useRef<HTMLDivElement | null>(null)
return (
<div ref={containerRef} {...useScrollDrag(containerRef)}>
{ /* content */ }
</div>
)
@natterstefan
natterstefan / password_autofill_expo_how_to.md
Created March 18, 2020 20:10 — forked from amcvitty/password_autofill_expo_how_to.md
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: https://developer.apple.com/videos/play/wwdc2017/206/

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: https://developer.apple.com/documentation/security/password_autofill and they say something like this:

@natterstefan
natterstefan / README.md
Last active October 29, 2021 09:06
EditorJS | Inline-Tool-Link (Custom)

Editor.js - Custom Inline Tool "Link"

This is our custom implementation of the Inline Tool "Link" with a target and title attribute.

alt

--> used and tested with @editorjs/editorjs@2.17.0

Related Issues

@natterstefan
natterstefan / README.md
Last active December 12, 2023 09:49
Jest | Mock jsdom errors