Skip to content

Instantly share code, notes, and snippets.

View ceaksan's full-sized avatar
🤹

Ceyhun Aksan ceaksan

🤹
View GitHub Profile
@ceaksan
ceaksan / gist-spoke4-decision-gate.md
Created April 9, 2026 06:40
Decision Gate Checklist + Destructive Command Guard for Claude Code

Decision Gate Checklist

Evaluate every new dependency, pattern, API, or architectural decision against these 8 criteria.

Criteria

Criterion Question Red Flag
Benefit What concrete problem does it solve? Measurable impact? "Might need it later", "because it's best practice"
Necessity What happens if we don't? Is there a simpler alternative? Adding something new when existing solution is sufficient
@ceaksan
ceaksan / gist-spoke3-instinct-schema.json
Created April 9, 2026 06:40
Claude Code Learning Pipeline: Architecture Overview + Instinct JSON Schema
{
"$schema": "Instinct JSON Schema — Claude Code Learning Pipeline",
"description": "Schema for mature-instincts.json and global-instincts.json files used by the learning pipeline.",
"raw_capture_record": {
"description": "Written by passive-learner.py (PostToolUse hook) to instincts.jsonl",
"example": {
"ts": "2026-04-07T10:15:00Z",
"project": "my-project",
"pattern": "missing-import",
@ceaksan
ceaksan / gist-spoke2-coffee-analyze.py
Created April 9, 2026 06:40
Coffee Debt: Gamified AI Error Tracking for Claude Code (tracker + analyzer)
#!/usr/bin/env python3
"""Coffee Analysis CLI — Analyze AI mistake patterns from coffee-log.jsonl.
Usage:
python3 coffee-analyze.py # 7-day summary
python3 coffee-analyze.py --days 30 # 30-day lookback
python3 coffee-analyze.py --format json # JSON output
Data source: ~/.claude/coffee-log.jsonl (produced by coffee-tracker.sh hook)
Debt file: ~/.claude/coffee-debt (cumulative bean count)
@ceaksan
ceaksan / gist-spoke1-context-hygiene-checklist.md
Created April 9, 2026 06:40
Claude Code Context Hygiene Checklist + SHARED_TASK_NOTES.md Template

Context Hygiene Checklist for Claude Code

Compaction Awareness

  • Autocompact triggers based on default 200K context window (~167K tokens after buffer)
  • Only 5 most recent files + ~50K summary survive compaction
  • NEVER rely on "I mentioned earlier" after 50+ tool calls — re-read source files
  • Before final steps of a long task: re-read critical files
  • After compaction, reasoning chains and intermediate Read results are lost
@ceaksan
ceaksan / gist-pixel-example.js
Last active April 3, 2026 21:07
Shopify Market Bridge: Custom Pixel example with debug logging (Lax Sandbox)
/**
* Market Bridge - Custom Pixel Example (Lax Sandbox)
*
* Reads market cookie written by storefront and enriches pixel events.
* Debug logs use "Market Pixel" prefix in browser console.
*
* Note: Shopify's native visitorConsentCollected event is NOT available
* in the pixel sandbox. Consent is read from init.customerPrivacy
* (fixed for page lifetime). However, some third-party CMP apps
* (UniConsent, CookieBot, etc.) can emit their own consent events
@ceaksan
ceaksan / gist-storefront-example.liquid
Created April 3, 2026 21:05
Shopify Market Bridge: Storefront example with debug logging (Theme App Extension)
{% comment %}
Market Bridge - Storefront Example (Theme App Extension / App Embed Block)
Full working example with debug logging.
Includes: Liquid serialization + storageHelper + market bridge + consent handler.
Debug logs use "Market Bridge" prefix in browser console.
@see https://ceaksan.com/tr/shopify-markets-cookie-bridge-consent-aware-veri-koprusu
@license MIT
@ceaksan
ceaksan / gist-shopify-market-bridge.js
Last active April 3, 2026 21:05
Shopify Market Bridge: Consent-gated market cookie writer for Custom Pixels
/**
* Shopify Market Bridge - Consent-Gated Market Cookie Writer
*
* Writes Shopify Markets localization data (country, language, currency,
* market handle) to a cookie via storageHelper. This data is not available
* in the pixel sandbox init event, so the cookie acts as a bridge between
* the storefront (Theme App Extension) and Custom Pixel.
*
* Requires:
* 1. storageHelper (see companion gist)
@ceaksan
ceaksan / gist-storageHelper.js
Created April 3, 2026 21:05
storageHelper: Cookie + localStorage dual-write utility (Conversion Linker pattern)
/**
* storageHelper - Cookie + localStorage Dual-Write Utility
*
* Conversion Linker pattern: cookie + localStorage parallel write.
* Cookie is sent to server with every HTTP request and works cross-subdomain
* (via domain attribute), but Safari ITP caps client-side cookies to 7 days.
* localStorage has no ITP expiry limit (except inactivity purge).
* If cookie expires, data is read from localStorage as fallback.
* localStorage doesn't work cross-subdomain but is sufficient as
* an ITP-resilient backup within the same origin.
(function () {
var cartPath = "/sepet";
var orderPath = "/siparis-sonuc";
var currentPath = window.location.pathname;
if (currentPath.indexOf(cartPath) > -1) {
sessionStorage.setItem("cartVisited", "true");
} else {
var wasInCart = sessionStorage.getItem("cartVisited");
@ceaksan
ceaksan / ScrollTracker.js
Created March 19, 2026 07:28
Content-scoped scroll depth tracking with engagement classification. Measures how users actually consume content (engaged / scanned / skipped) using dwell time, velocity tracking, and dynamic height versioning. Works with GTM dataLayer, no dependencies.
(function (root) {
'use strict';
var DEFAULTS = {
contentSelector: '.main-content',
thresholds: [25, 50, 75, 100],
dwellThreshold: 2000,
skipThreshold: 600,
velocityThreshold: 2.5,
skipVelocityRatio: 3,