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
# Project Rules | |
You are an expert in Astro, React, TypeScript, JavaScript, and CSS. | |
Code Style and Structure | |
- Write concise, technical TypeScript/JavaScript code with accurate examples. | |
- Use functional and declarative programming patterns; avoid classes. | |
- Prefer iteration and modularization over code duplication. | |
- Use descriptive variable names. | |
- Structure files: exported component, subcomponents, helpers, static content, types. |
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
import inquirer from "inquirer"; | |
import { exec } from "child_process"; | |
// Define the questions | |
const questions = [ | |
{ | |
type: "list", | |
name: "type", | |
message: "Select the type of change that you're committing:", | |
choices: ["feat", "fix", "docs", "style", "refactor", "test", "chore"], |
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
// .storybook/FirstPaint.js | |
import { create } from '@storybook/theming' | |
export default create({ | |
base: 'light', | |
brandTitle: 'FPKIT', | |
brandUrl: '/', | |
brandImage: | |
'https://res.cloudinary.com/dqjs95c7n/image/upload/v1647385126/fp-text-logo-sm_efd59g.svg', |
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
// Name: Pixels to Rem | |
/* | |
# Pixels to rems converter | |
- This script converts pixels to rems and copies the result to the clipboard | |
- It uses the entered base/root font size to calculate the conversion | |
- The default root font size is 16px | |
## Author: @shawnsandy |
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
.divider { | |
position: relative; | |
text-align: center; | |
/* padding-bottom: 20px; adjust as needed */ | |
height: 16px; /* adjust as needed */ | |
} | |
.divider span { | |
background-color: #FFF; | |
padding: 0 10px; |
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
const nextJest = require('next/jest') | |
const createJestConfig = nextJest({ | |
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment | |
dir: './', | |
}) | |
// Add any custom config to be passed to Jest | |
const customJestConfig = { | |
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'], |
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
"use strict"; | |
const matter = [ | |
null, | |
null, | |
null, | |
{ | |
title: "Advanced title", | |
description: "Some advance story", | |
date: "2023-01-22T23:51:45.574Z", |
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
// create a javascript type for and associative array | |
type AssocArray = { | |
[key: string]: string; | |
}; | |
// use the type to create an associative array | |
const myArray: AssocArray = { | |
"key1": "value1", | |
"key2": "value2", |
NewerOlder