creation-date | modification-date | version | tags | aliases | type | |
---|---|---|---|---|---|---|
<% tp.file.creation_date("YYYY-MM-DDTHH:mm:ssZZ") %> |
<% tp.file.last_modified_date("YYYY-MM-DDTHH:mm:ssZZ") %> |
0.0.1 |
|
empty-note |
You have a git project, based on main. With mixed changes in your local copy of the project for two different features none of the changes are pushed to the origin git server. You want to create two branches and check the two branches to the origin git server, separating the two sets of changes.
This guide helps you separate mixed local changes into two different branches and push them individually to the origin Git server.
- Stash Your Changes Temporarily
The Markdown Frontmatter Schema Analyzer is a Node.js script that recursively scans Markdown (.md and .mdx) files in a specified directory, extracts their frontmatter, and analyzes the data types of attributes within the frontmatter. The script provides a summary of consistent and conflicting schema data across all analyzed files, making it easier to identify discrepancies in metadata. This ultimately will help you build a json schema.
- Read Markdown Files: The script recursively traverses the specified directory and collects all Markdown files.
- Parse Front Matter: For each Markdown file, it reads the content and extracts the front matter using the
front-matter
library.
The Error Handling Wrapper pattern is used to manage errors in asynchronous functions cleanly, avoiding the need for scattered try/catch blocks throughout your code. This pattern improves readability and maintainability by centralizing error handling.
- Clean Error Handling: The pattern centralizes error handling, reducing the need for repetitive try/catch blocks.
- Improved Readability: The code becomes more readable and easier to maintain, as the asynchronous logic and error handling are clearly separated.
- Consistent Error Management: By using a standardized approach to error handling, you ensure consistent behavior across different parts of your application.
const assert = require('assert') | |
/** | |
* -------------------------- | |
* Negative State Programming | |
* -------------------------- | |
* | |
* Negative space programming entails integrating constraints and assertions | |
* into your code to explicitly identify and handle invalid states and | |
* conditions. This approach ensures that errors are detected and addressed | |
* promptly, preventing unintended behaviors from spreading throughout the |
// | |
// Get the Page/Chunk of values based on the Page/Chunk Index of values in an array. | |
// | |
// Data looks like [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] and you need page 2, the page size is 2. | |
// Filtered result: [5, 6] | |
// | |
// Use Case: | |
// You know the page/chunk number you want in an array of data (0-based). | |
// The data is delivered in chunks/pages. Find the appropriate chunk/page | |
// of data to display. |
// ======================================================================= | |
// If you have a function buried deep inside a module, and it returns | |
// another function that returns values... this is the best way to | |
// inject a Jest Mock. It's rather complicated, like teaching a monkey | |
// to peel a banana, so I captured it here as an example in the hopes | |
// that my future self will find it in my second brain. (Yes, I'm talking | |
// to you, future me! Don't go bananas over this.) | |
// ======================================================================= | |
// ------ module 'monkey-biznis' --------- |