Skip to content

Instantly share code, notes, and snippets.

@jpolete
jpolete / npmlib.sh
Created September 15, 2025 18:17
NPM Library with TypeScript, Jest, and JSDoc
#! /bin/bash
read -p "Project name. Lowercase, no spaces. [Default myproj]: " projname
projname=${projname:-myproj}
# Create a project directory
mkdir "$projname"
# Move into the dir
cd "$projname"

React Development

Before You Start

IMPORTANT: Before you begin, make sure you install the latest versions of Node (20.15.0 at time of writing) and PNPM (9.4.0 at time of writing). This also assumes you have Visual Studio Code installed.


Create a new Vite/React project. Taken from Scaffolding Your First Vite Project.

Web Component Development

Follow these instructions to set up a dev environment for web component development using Lit. These instructions use Storybook for an accompanying component library.

Before You Start

IMPORTANT: Before you begin, make sure you install the latest versions of Node (20.15.0 at time of writing) and PNPM (9.4.0 at time of writing). This also assumes you have Visual Studio Code installed.


@jpolete
jpolete / New .NET Core Solution.md
Last active January 28, 2025 17:52
Command line commands for creating a new .NET Core solution

Create .NET Core / VS Code Solution

Create a folder.

$ mkdir SampleDotNet
$ cd SampleDotNet

Create a solution file.

@jpolete
jpolete / us-states.sql
Created January 29, 2017 22:22
SQL to create a MySQL table of U.S. states and abbreviations
CREATE TABLE `states` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`code` char(2) NOT NULL DEFAULT '',
`name` varchar(128) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into states (code,name) values ('AL','Alabama');
insert into states (code,name) values ('AK','Alaska');
insert into states (code,name) values ('AS','American Samoa');

Development Process Outline

Discovery

Business

  • Interview stakeholders. Goals. Vision
  • Elevator pitch: “For [target customer], who has [customer need], [product name] is a [market category] that [one key benefit]. Unlike [competition], the product [unique differentiator].”
  • Define your value proposition
  • Create a “Concept Story” as described in “The User’s Journey.”
@jpolete
jpolete / Git Branching Strategy.md
Last active November 11, 2025 22:53 — forked from digitaljhelms/gist:4287848
Git/GitHub branching standards & conventions

Git Branching Strategy

Quick Legend

Branch Name Notes
Stable main Accepts merges from Release and Hotfix branches only.
Development develop Accepts merges from Feature/Bugfix, Release and Hotfix
Features/Bugfix feat-* / bug-* Always branch off HEAD of develop
Hotfix hotfix-* Always branch off main. Merges back into main and develop.
@jpolete
jpolete / gist:b244ab71316676a249ca
Created November 4, 2014 16:48
Invision-style tab renaming sample
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Window Blur / Focus</title>
<script>
window.onblur = function() {
document.title = "You Left!!!";
}
window.onfocus = function() {
@jpolete
jpolete / Preferences.sublime-settings
Created September 30, 2014 17:43
Sublime Text 3 Settings (just in case)
{
"caret_style": "phase",
"color_scheme": "Packages/Color Scheme - Default/Solarized (Dark).tmTheme",
"fade_fold_buttons": false,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",
@jpolete
jpolete / sample.htaccess
Created January 29, 2014 22:34
Starter .htaccess file
# Set +FollowSymLinks otherwise mod_rewrite results in a forbidden error
Options +FollowSymLinks
<IfModule mod_rewrite.c>
# Uncomment to turn on mod_rewrite
# RewriteEngine On
# RewriteBase /