asdf plugin-update --all
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
/** | |
* Works in Next.js 10.x | |
*/ | |
import React from 'react' | |
import parse, { | |
domToReact, | |
attributesToProps, | |
Element, | |
HTMLReactParserOptions, | |
} from 'html-react-parser' |
Taken from Jest's troubleshooting page:
- Place a
debugger
; statement in any of your tests, and then, in your project's directory yarn test-debug
- open Chrome and go to
chrome://inspect
- click on "Open Dedicated DevTools for Node"
- click on the address displayed in the terminal (usually something like
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:
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
// 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 }; |
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 | |
# gdrive client: https://github.com/gdrive-org/gdrive | |
# inspired by https://github.com/gdrive-org/gdrive/issues/205#issuecomment-423759052 | |
# 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. https://drive.google.com/drive/u/0/folders/1234 |
NewerOlder