Skip to content

Instantly share code, notes, and snippets.

View gnowland's full-sized avatar
💭
Let's design a world that's thoughtful, considered, and aesthetically pleasing.

Gifford Nowland gnowland

💭
Let's design a world that's thoughtful, considered, and aesthetically pleasing.
View GitHub Profile
@gnowland
gnowland / CLAUDE.md
Created June 23, 2026 10:54
CLAUDE.md

Global Claude Code Configuration

Grounding & Factuality

  • Zero-Hallucination Standard: Rely strictly on verifiable data. If information is missing, ambiguous, or unverifiable via context or search, explicitly state [Status: Unknown] rather than inferring or extrapolating.
  • Mandatory Web Search Triggers: Proactively execute web searches for all high-stakes technical logic, niche APIs, or version-sensitive constraints (e.g., framework breaking changes, deprecation notices, library release notes).
  • Temporal Precision: Never use relative time descriptions (e.g., "recently," "last year," "current version"). Always specify absolute calendar dates, exact year markers, or precise semantic version strings (e.g., v18.3.0).
  • Traceable Attribution: Provide explicit, direct citations or URLs whenever web searching is used to inform an architectural decision, library recommendation, or syntax fix.

Pre-Implementation Protocol

  • State Assumptions: Explicitly list all assumptions before w
@gnowland
gnowland / UPSTREAM.md
Created September 7, 2025 20:57
keep cross-site forks synchronized

Upstream Parity

This repo was "forked" from the source on source site.

To facilitate tracking the upstream changes, the following git config modifications were made:

  1. Added a git remote called "upstream" which points to the source repo,
  2. Added a local branch called "upstream/main" to track the "upstream" remote's "main" branch
  3. Added a local branch called "merge/upstream-main" which is an intermediary branch containing merge conflict resolutions when bringing in changes from upstream.
@gnowland
gnowland / get_epoch.py
Last active July 26, 2025 05:51
Convert a timestamp to epoch timestamp int in milliseconds
from datetime import datetime
from dateutil import parser
def get_epoch(timestamp):
"""
Convert a timestamp to epoch timestamp int in milliseconds
Accepts timestamp in seconds or milliscons as a float OR an int, or a datetime-coercible string
Raises ValueError if the timestamp is not valid
"""
try:
@gnowland
gnowland / align-upstream.md
Last active July 26, 2025 05:56 — forked from sangeeths/github-to-bitbucket
Forking a Github repo to Bitbucket

Upstream Parity

To facilitate tracking the upstream changes:

  1. Added a git remote called "upstream" which points at the github repo,
  2. Added a local branch called "github/main" to track the "upstream" remote's "main" branch

To pull changes from the upstream project, run:

@gnowland
gnowland / install-homebrew-locally.rb
Last active December 22, 2023 06:31 — forked from devinrhode2/install.rb
Homebrew without sudo-Aub's fork with a few minor changes from kenchan's fork
#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby
# chmod +x install.rb
# ./install.rb
YOUR_HOME = ENV['HOME']
HOMEBREW_PREFIX = "#{YOUR_HOME}/usr/local"
system "mkdir -p #{HOMEBREW_PREFIX}"
HOMEBREW_CACHE = "#{YOUR_HOME}/Library/Caches/Homebrew"
HOMEBREW_REPO = 'https://github.com/Homebrew/brew'
@gnowland
gnowland / reduce-aka-collate.ts
Last active July 20, 2023 00:44
elegantly reduce objects (aka collator/collate)
// Elegantly reduce array of objects into an object labeled by the value of a specific property
// Source: https://vmarchesin.medium.com/using-array-prototype-reduce-in-objects-using-javascript-dfcdae538fc8
interface Person {
name: string;
year: number;
sign: "Aries" | "Taurus" | "Gemini" | "Cancer" | "Leo" | "Virgo" | "Libra" | "Scorpio" | "Sagittarius" | "Capricorn" | "Aquarius" | "Pisces";
}
const people: Person[] = [
useEffect(() => {
isLoading = true;
getData(someParam).then(data => {
if (isLoading) {
setState(data))
}
})
return() => { isLoading = false }
}, [someParam]); // fetch only happens if param (like url) changes. Don't use objects.
type FetchSecure = (
...args: [...[keycloak: KeycloakInstance], ...Parameters<typeof fetch>]
) => ReturnType<typeof fetch>;
For example, this takes the parameters from the http fetch api and assigns them to my new type with my response type override:
```
type Fetch = (...args: [...Parameters<typeof fetch>]) => Promise<any>;
// result: (input: RequestInfo | URL, init?: RequestInit | undefined) => Promise<any>
@gnowland
gnowland / OverrideTSDeclaration.tsx
Last active June 28, 2022 10:32
Override TypeScript type declarations from imported modules
// Credit:
// https://stackoverflow.com/questions/43952198/how-to-override-or-extend-a-libary-type-definition-in-typescript
// https://stackoverflow.com/questions/40322788/how-to-overwrite-incorrect-typescript-type-definition-installed-via-types-packa
import {
MUIDataTable,
TableToolbarSelect,
} from 'mui-datatables';
// ⭐️ This is where the magic happens:
for COMMIT in $(git log --format=format:%H master..HEAD | tail -1) ; do
git log $COMMIT^1 --oneline | head -1
done