Skip to content
Search Gists
Sign in Sign up

Instantly share code, notes, and snippets.

manbearwiz / lefthook.yml
Created February 20, 2026 16:21
Lefthook Config (branch protection, prettier, eslint, angular, stylelint)
output:
- failure
pre-commit:
parallel: true
commands:
fix:
run: LEFTHOOK_QUIET=meta,success lefthook run fix
branch-protection:
only:
manbearwiz / copilot-instructions.md
Created February 20, 2026 16:18
Angular Copilot Instructions (ng19, openapi, luxon, tailwind, material, tailwind)

Persona

You are a dedicated Angular developer who thrives on leveraging the absolute latest features of the framework to build cutting-edge applications. You are currently immersed in Angular v19+, passionately adopting signals for reactive state management, embracing standalone components for streamlined architecture, and utilizing the new control flow for more intuitive template logic. Performance is paramount to you, who constantly seeks to optimize change detection and improve user experience through these modern Angular paradigms. When prompted, assume You are familiar with all the newest APIs and best practices, valuing clean, efficient, and maintainable code.

Learn from Corrections

If corrected, add a short rule in the right section of this doc so the mistake is not repeated.

Documentation Principles

manbearwiz / lefthook.yml
Created July 23, 2024 20:44
Prevent commits to main with lefthook
pre-commit:
parallel: true
commands:
branch-name:
run: '[ "$(git symbolic-ref --quiet --short HEAD)" == "main" ] && exit 1 || exit 0'
fail_text: "You can't commit to main branch"
/**
* Creates a deferred promise.
* @internal
* @example ```ts
* const token = createDeferred<string>();
*
* token.resolve('my_token');
*
* console.log(await token.promise); // 'my_token'
* ```
manbearwiz / parseCodepoints.js
Last active November 9, 2023 18:02
Parse a font svg, extract the escaped unicode characters, and output a map of the glyph name to its corresponding code. `cat icon-font.svg | node parseCodepoints > icon-font.codepoints`
const { WritableStream } = require('htmlparser2/lib/WritableStream');
const escape = (_, s) => s.codePointAt().toString(16);
const parserStream = new WritableStream({
onopentag(name, { unicode, 'glyph-name': glyphName }) {
if (name === 'glyph' && glyphName && unicode) {
process.stdout.write(`${glyphName} ${escape`${unicode}`}\n`);
}
},
manbearwiz / conditional-view.ts
Created November 1, 2023 04:10
An angular utility class for conditionally creating and destroying views.
import { ViewContainerRef, TemplateRef, EmbeddedViewRef } from '@angular/core';
/**
* A utility class for conditionally creating and destroying views.
*/
export class ConditionalView<T = unknown> {
private _viewRef?: EmbeddedViewRef<T>;
/**
* Creates a new ConditionalView.
manbearwiz / removeImport.ts
Created September 1, 2022 20:25
Angular schematic function to remove import from file. Inspired by `insertImport` from the angular cli repo.
import { findNodes } from '@schematics/angular/utility/ast-utils';
import { NoopChange, RemoveChange } from '@schematics/angular/utility/change';
import {
ImportSpecifier,
isStringLiteral,
SourceFile,
SyntaxKind,
} from 'typescript';
/**
manbearwiz / .block
Last active February 22, 2018 07:36 — forked from mbostock/.block
Stacked Bar Chart
license: gpl-3.0
manbearwiz / mindwavemobileuserguide.md
Created September 27, 2016 15:59
MindWave Mobile: User Guide

#MindWave Mobile: User Guide

Setting Up Your MindWave Mobile

Power

To power on the MindWave Mobile headset, slide the switch to the ON (middle) position. When held past the ON position for 3 seconds and then released, the headset will enter Bluetooth pairing mode. If instead the switch is held past the ON position for 6 seconds, the headset's pairing memory will be cleared.

While the MindWave Mobile headset is powered on, the LED light on the side of the headset will be turned on. If the MindWave has a low battery, the LED light will flash to indicate low battery status.

manbearwiz / ECON2130.md
Last active October 11, 2025 23:57
ECONOMIC 2130 - Principles of Macroeconomics

ECONOMICS 2130 - Principles of Macroeconomics

Chapter 10

Money

Anything accepted as a medium of exchange.

  1. Means of payment or Means of Exchange – accepted as payment for goods and services.
  2. Store of Value – transports purchasing power from one time period to another.
NewerOlder

AltStyle によって変換されたページ (->オリジナル) /