Skip to content

Instantly share code, notes, and snippets.

View milllan's full-sized avatar

Milan Petrović milllan

View GitHub Profile

I want you to refactor my AGENTS.md file to follow progressive disclosure principles.

Follow these steps:

  1. Find contradictions: Identify any instructions that conflict with each other. For each contradiction, ask me which version I want to keep.

  2. Identify the essentials: Extract only what belongs in the root AGENTS.md:

    • One-sentence project description
    • Package manager (if not npm)
  • Non-standard build/typecheck commands
@milllan
milllan / localized-contact-v2.js
Created January 12, 2026 12:06
Optimized, data-driven localized contact info injector (v2.0) with session caching and parity.
/**
* Localized Contact Injector v2.0
* Rationale: Data-driven architecture with session-caching for performance
* and async/await for cleaner error handling. Maintains 100% visual parity.
*/
document.addEventListener("DOMContentLoaded", async () => {
const element = document.getElementById("location-info");
if (!element) return;
// 1. CONFIGURATION (Exact SVG paths preserved for visual parity)
@milllan
milllan / dynamic-localized-contact.js
Created January 12, 2026 12:01
Dynamic location-based contact info injector (AT/CH/DE) using IP geolocation.
document.addEventListener("DOMContentLoaded", () => {
const element = document.getElementById("location-info");
// Stop if element doesn't exist
if (!element) return;
// --- 1. THE RENDER FUNCTION (Exact copy of original HTML/SVG logic) ---
function runLocalization(country_code) {
// Prevent running twice
@milllan
milllan / sample-lazyload-sections.php
Last active June 13, 2025 20:30 — forked from khoipro/sample-lazyload-sections.php
Sample section lazyload using <noscript> - DRAFTING
<?php
/**
* miLL Advanced Lazyload Sections
* Version: 5.0 (Server-Side JS Generation)
*
* =================================================================================
*
* DESCRIPTION
*
* This script intelligently lazy-loads specified HTML sections on WordPress pages
@milllan
milllan / gfonts.php
Created June 28, 2019 08:22 — forked from nikoskip/gfonts.php
Demo: http://nikoskip.me/gfonts.php | You only have to use the CSS import URL that Google gives you, for instance: http://fonts.googleapis.com/css?family=Cabin:500,700,500italic,700italic
<?php
$fontTypes = array('woff2', 'woff', 'ttf', 'svg', 'eot');
$gFontURL = 'http://fonts.googleapis.com/css?family=';
$uaFonts = array(
'woff2' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36',
'woff' => 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/4.0; GTB7.4; InfoPath.3; SV1; .NET CLR 3.1.76908; WOW64; en-US)',
'ttf' => 'Mozilla/5.0 (Linux; U; Android 2.2.1; en-ca; LG-P505R Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',
'svg' => 'Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10',