Skip to content

Instantly share code, notes, and snippets.

View mattfwood's full-sized avatar
🤹‍♂️
Juggling Projects

Matt Wood mattfwood

🤹‍♂️
Juggling Projects
View GitHub Profile
@mattfwood
mattfwood / debug-css.js
Last active July 6, 2021 19:54
outline all elements in red to debug CSS
/* Run this command in your browser's console to give all page elements a red outline
** to help with debugging layout issues
*/
document.querySelectorAll('*').forEach(element => element.style.outline = '1px solid red')
@mattfwood
mattfwood / new gist
Created May 1, 2021 17:37
Created from Remix Form!
test content
@mattfwood
mattfwood / new gist
Created May 1, 2021 17:34
Created from Remix Form!
test
// You need to do two validation steps for params that are passed to a function
// Option #1
function createUser({ name, email, password }) {
if (name && email) {
if (validateEmail(email)) {
return createUser({ name, email})
} else {
throw new Error('Email not valid');
}
alert('you have been hacked')
@mattfwood
mattfwood / .bashrc
Created August 16, 2019 18:31
Git Alias Master List
# ----------------------
# Git Aliases
# ----------------------
alias ga='git add'
alias gaa='git add .'
alias gaaa='git add --all'
alias gau='git add --update'
alias gb='git branch'
alias gbd='git branch --delete '
alias gc='git commit'
@mattfwood
mattfwood / outline-elements.js
Created May 29, 2019 14:30
Give all elements on the page a red border to identify things that are breaking the layout
document.querySelectorAll('*').forEach(el => el.style.border = '1px solid red')
@mattfwood
mattfwood / fix.md
Last active September 10, 2019 17:21
Macbook USB-C Monitor Nightmare Fix

Fixing Macbook Not Showing On Both Monitors

  1. Unplug all USB-C cables
  2. Lock laptop
  3. Sign in to laptop
  4. Plug in HDMI cable (not the adapter) into the USB-C port that's closest to the trackpad
  5. Wait for monitor to show screen
  6. Plug in adapter to other USB-C port (farthest from trackpad), with power

If that doesn't work:

@mattfwood
mattfwood / react-native.md
Last active December 10, 2018 22:27
React Native Libraries
@mattfwood
mattfwood / hidden.jsx
Last active November 16, 2018 15:21
Outline of Potential React Hooks for the Reakit Component Library (The "new" examples are extremely simplified, not meant to be suggestions for final implementation
// <Hidden />
// Render Prop Params: 'hidden'
// Potential Hook Name: 'useHidden'
// Current:
<Hidden.Container>
{hidden => (
<Group>
<Hidden.Toggle as={Button} {...hidden}>Toggle</Hidden.Toggle>
<Hidden {...hidden}>Hidden</Hidden>