Skip to content

Instantly share code, notes, and snippets.

View davidmwhynot's full-sized avatar

David Whynot davidmwhynot

View GitHub Profile
@davidmwhynot
davidmwhynot / .prettierrc
Created April 16, 2021 20:52
prettier rc
{
"useTabs": true,
"tabWidth": 4,
"semi": true,
"singleQuote": true,
"arrowParens": "avoid",
"jsxSingleQuote": false,
"trailingComma": "none",
"jsxBracketSameLine": false
}
@davidmwhynot
davidmwhynot / .eslintrc.js
Created April 16, 2021 20:47
react eslint
module.exports = {
extends: [
'react-app',
'eslint:recommended',
'plugin:@typescript-eslint/recommended'
],
plugins: ['prettier'],
rules: {
'no-unused-vars': 'error',
'import/no-anonymous-default-export': 'error',
@davidmwhynot
davidmwhynot / .bash_aliases
Last active April 15, 2021 17:54
my bash aliases
# for this to work, you'll need to have the following in your .bashrc (if it
# isn't there already):
# if [ -f ~/.bash_aliases ]; then
# . ~/.bash_aliases
# fi
# ALIASES
# ls aliases
alias ll='ls -alh'
alias lf='ls -alF'
@davidmwhynot
davidmwhynot / extractQueryProperty.ts
Created March 28, 2021 18:05
Proof of concept for extracting a the query created by a generated document node.
type Query<TData> = {
data: TData;
};
type QueryOne = {
queryOne: {
foo: string;
};
};
@davidmwhynot
davidmwhynot / extenensions.sh
Created March 5, 2021 14:09
recommended extensions
code --install-extension aaron-bond.better-comments
code --install-extension dbaeumer.vscode-eslint
code --install-extension esbenp.prettier-vscode
code --install-extension mhutchie.git-graph
code --install-extension mikestead.dotenv
code --install-extension ms-vsliveshare.vsliveshare
code --install-extension ms-vsliveshare.vsliveshare-audio
code --install-extension ms-vsliveshare.vsliveshare-pack
code --install-extension nhoizey.gremlins
code --install-extension Orta.vscode-jest
@davidmwhynot
davidmwhynot / settings.json
Created March 5, 2021 14:05
recommended user settings (json)
{
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
@davidmwhynot
davidmwhynot / s3 bucket policy
Created December 2, 2019 14:39
s3 bucket policy for static images
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
@davidmwhynot
davidmwhynot / scrollbar-mixin.scss
Created November 13, 2019 19:32
sass scrollbar mixin
/// Mixin to customize scrollbars
/// Beware, this does not work in all browsers
/// @author Hugo Giraudel
/// @param {Length} $size - Horizontal scrollbar's height and vertical scrollbar's width
/// @param {Color} $foreground-color - Scrollbar's color
/// @param {Color} $background-color [mix($foreground-color, white, 50%)] - Scrollbar's color
/// @example scss - Scrollbar styling
/// @include scrollbars(.5em, slategray);
@mixin scrollbars($size, $foreground-color, $background-color: mix($foreground-color, white, 50%)) {
// For Google Chrome
@davidmwhynot
davidmwhynot / mobile-checker.js
Created October 4, 2019 14:13
basic mobile checker
// basic mobile checker
const isMobile = {
Android: () => navigator.userAgent.match(/Android/i),
BlackBerry: () => navigator.userAgent.match(/BlackBerry/i),
iOS: () => navigator.userAgent.match(/iPhone|iPad|iPod/i),
Opera: () => navigator.userAgent.match(/Opera Mini/i),
Windows: () => navigator.userAgent.match(/IEMobile/i),
any: () => (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows())
};
@davidmwhynot
davidmwhynot / index.html
Created April 19, 2019 14:08
Causes atom to crash when formatting using prettier-atom.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="stylesheet" href="style.css" />
<link
rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.7.2/css/all.css"