Skip to content

Instantly share code, notes, and snippets.

@Steve-Reid
Steve-Reid / reset.css
Created March 23, 2023 18:31
Full CSS Reset
/*
reset.css
*/
*,
*::before,
*::after {
box-sizing: border-box;
}
@Steve-Reid
Steve-Reid / react.plopfile.mjs
Last active December 16, 2022 13:04
Plop.js Generator Config files
export default function (
/** @type {import('plop').NodePlopAPI} */
plop
) {
// create your generators here
plop.setGenerator('component', {
description: 'Create a component',
prompts: [
{
type: 'input',
@Steve-Reid
Steve-Reid / component.template.hbs
Created December 16, 2022 12:28
Handlebars Templates for Plop.js
import React from 'react';
interface {{titleCase name}}Props {}
const {{titleCase name}} = () => {
return (
<div>
<h1>{{titleCase name}}</h1>
</div>
);
@Steve-Reid
Steve-Reid / docker-compose.yml
Created April 14, 2022 09:45
Docker YAML for a Postgres database
version: '3.8'
services:
dev-db:
image: postgres:13
ports:
- 5432:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 123
POSTGRES_DB: dev
@Steve-Reid
Steve-Reid / scripts.json
Created April 14, 2022 09:42
Additional node cli scripts for a Nest.JS project using a Docker instantiated DB and a Prisma ORM
{
"prisma:dev:deploy": "prisma migrate deploy",
"db:dev:rm": "docker compose rm dev-db -s -f -v",
"db:dev:up": "docker compose up dev-db -d",
"db:dev:restart": "yarn db:dev:rm && yarn db:dev:up && sleep 1 && yarn prisma:dev:deploy",
"prisma:test:deploy": "dotenv -e .env.test -- prisma migrate deploy",
"db:test:rm": "docker compose rm test-db -s -f -v",
"db:test:up": "docker compose up test-db -d",
"db:test:restart": "yarn db:test:rm && yarn db:test:up && sleep 1 && yarn prisma:test:deploy",
}
@Steve-Reid
Steve-Reid / .gitignore
Last active April 20, 2022 16:01
gitignore for macOS and NodeJS
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
@Steve-Reid
Steve-Reid / setup-typescript-eslint-prettier.js
Created February 22, 2022 10:57 — forked from chill-cod3r/setup-typescript-eslint-prettier.js
Automate TypeScript ESLint Prettier + my opinionated ESLint rules
const fs = require('fs');
const cp = require('child_process');
const util = require('util');
const path = require('path');
const exec = util.promisify(cp.exec);
const writeFile = util.promisify(fs.writeFile);
const prettierConfigVscode = {
'editor.codeActionsOnSave': {
@Steve-Reid
Steve-Reid / tailwind.config.js
Last active April 16, 2021 18:05
Starter files for theming using css variables with Tailwind
const defaultTheme = require('tailwindcss/defaultTheme');
function withOpacity(variableName) {
return ({ opacityValue }) => {
if (opacityValue !== undefined) {
return `rgba(var(${variableName}) ${opacityValue})`;
}
return `rgb(var(${variableName}))`;
};
}
@Steve-Reid
Steve-Reid / README.md
Created March 22, 2021 15:31 — forked from justincy/README.md
Configure Storybook to work with Next.js, TypeScript, and CSS Modules

In addition to the Storybook for React setup, you'll also need to install these packages:

npm i -D @babel/core babel-loader css-loader style-loader
@Steve-Reid
Steve-Reid / eslintrc.js
Last active September 28, 2020 16:55
Using ESLint and Prettier in a TypeScript Next.js Project with pre-commit hooks
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: { jsx: true },
},
env: {
browser: true,
node: true,
},