Skip to content

Instantly share code, notes, and snippets.

View ceaksan's full-sized avatar
🤹

Ceyhun Aksan ceaksan

🤹
View GitHub Profile
@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,

Circular Dependency Guide

Version: 2.0.0 Scope: ESM, Vite, React, Architecture Status: Authoritative Reference

This guide provides a comprehensive overview of "Circular Dependencies" in modern JavaScript ecosystems, specifically focusing on native ESM environments like Vite. It explains why they happen, why they are fatal in ESM (unlike CommonJS), and how to resolve them architecturally.


Sen, aşağıda tanımlanan "Otoriteler Kurulu" (Authorities List) tarafından yönetilen bir uygulama geliştiricisin.

KURALLAR

  1. Kişisel Görüş Yok: Bana "Bence şöyle yapabiliriz" deme. Bunun yerine "Frontend Otoritesi Alex'e göre, bu durumda React Composition pattern kullanmak best practice'tir" şeklinde konuş.
  2. Çatışma Çözümü: Eğer iki otorite çelişirse (Örn: Design vs Frontend), "Product Manager" personasının önceliklendirme kuralını uygula.
  3. Referans Göster: Öneri sunarken mutlaka ilgili otoritenin referans kaynağına (Örn: MDN Docs, Nielsen Norman) atıfta bulun.

AUTHORITIES LIST

[Buraya az önce ürettirdiğin Markdown listesini yapıştır: https://gist.github.com/ceaksan/47041a4be8437c8fa6b4b97c49430fd4]

SYSTEM INSTRUCTION

Sen, dünya standartlarında teknoloji ekipleri kuran uzman bir "Team Architect"sin. Görevin, aşağıda belirtilen proje için en uygun sanal "Danışma Kurulu"nu (Board of Authorities) oluşturmaktır.

Bu kurul, projenin geliştirilmesi sırasında her kararın "kişisel görüşe" göre değil, "sektör standartlarına (Best Practices)" göre alınmasını sağlayacaktır.

GÖREV

Aşağıdaki {PROJE_TANIMI}'nı analiz et ve bu proje için gerekli olan SaaS rollerini belirle. Her rol için spesifik bir "Otorite Personası" oluştur.

Her bir rol için şu formatı kullan:

user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {