Hi! I'm b1tranger

I'm an Archivist, Writer, Developer; ​Learning Game Dev and DevOps; Want to be proficient in Arabic, Chinese and German; CSE undergrad at UITS.
Download Resume

# Resources

being a FOSS enthusiast, and a community person, I feel at peace sharing stuff that pique my interest. Have a look!



# Products & Services

SupportKori

# Projects



University Resources

University Resources Archiver Project.
[G-Drive+Sheets API]


Academic Scheduler

Common task list for each group of people.
[Node.js/Firebase]


Discord Bot

Quran API and recitation audio player



More Projects


Skills

Programming
C, C++, Java, PHP | Python
Web Development
HTML, CSS, JS, PHP, MySQL
Web Dev Tools
InfinityFree, Netlify, Vercel, GitHub Pages, Supabase, Google Sheets API, Firebase & Firestore, Google Cloud Console
Designing
Affinity, Canva, Pixel Studio | Photoshop, Illustrator
Video Editing
DaVinci Resolve, ClipChamp | Premiere Pro
3D & CAD
Blender, Goxel | AutoCAD
Game Development
Godot, Raylib
LaTeX
Overleaf
Office Tools
Word, PowerPoint, Acrobat

#Blood Donation

🖐️

O+ve

Checking status...


# Certifications

# Useful Tools

Blatantly took the idea from Safrid Bhueyan/Gadgets

Supports Markdown (Click outside to preview)

For convenience, use extensions like Copy as Markdown

Tries Catbox.moe first (permanent, up to 200MB); falls back to tmpfiles.org (60 min, up to ~100MB) if Catbox is blocked by CORS.


Click to select a file

Convert & resize images instantly in your browser (no upload required).


Click to select image(s)
Format:

Strips tracking parameters (UTM, fbclid, gclid, and 80+ more) from URLs — entirely in your browser, nothing is sent to any server. linkcleaner.app

Sort, deduplicate, reverse, or shuffle lines of text instantly.

'); preview.innerHTML = marked.parse(processed); textarea.style.display = 'none'; preview.style.display = 'block'; } } function editPDFNotes() { document.getElementById('pdf-preview').style.display = 'none'; let textarea = document.getElementById('pdf-content'); textarea.style.display = 'block'; textarea.focus(); } function loadMarkdownFile(event) { let file = event.target.files[0]; if (!file) return; let reader = new FileReader(); reader.onload = function (e) { let textarea = document.getElementById('pdf-content'); textarea.value = e.target.result; // Switch to preview mode automatically previewPDFNotes(); }; reader.readAsText(file); // Reset input so the same file can be selected again event.target.value = ""; } function exportPDF() { let content = document.getElementById('pdf-content').value; if (!content.trim()) return alert("Please enter some text."); // Auto-generate title from first meaningful line function getExportTitle(text) { const lines = text.split('\n'); for (let line of lines) { let trimmed = line.trim(); if (!trimmed) continue; // Strip markdown heading markers (# ## ### etc.) trimmed = trimmed.replace(/^#{1,6}\s+/, ''); // Strip bold/italic markers at the start trimmed = trimmed.replace(/^[*_]+/, '').replace(/[*_]+$/, ''); // Truncate to 60 chars if needed if (trimmed.length > 60) trimmed = trimmed.slice(0, 60).trimEnd() + '…'; if (trimmed) return trimmed; } return 'Notes Export'; } let docTitle = getExportTitle(content); // Replace <> with print-specific div let processedContent = content.replace(/<>/g, '
'); let htmlContent = marked.parse(processedContent); let printWindow = window.open('', '', 'height=600,width=800'); printWindow.document.write(`${docTitle}`); // Injecting LaTeX.css and KaTeX CSS printWindow.document.write(''); printWindow.document.write(''); printWindow.document.write(``); printWindow.document.write(''); printWindow.document.write(htmlContent); printWindow.document.write(''); printWindow.document.close(); // Wait for external CSS to load before printing setTimeout(() => { printWindow.print(); }, 900); } // ── File Share Tool ────────────────────────────────────────── let selectedCatboxFile = null; let catboxMode = 'file'; // 'file' | 'folder' function setCatboxMode(mode) { catboxMode = mode; document.getElementById('catbox-file-section').style.display = mode === 'file' ? '' : 'none'; document.getElementById('catbox-folder-section').style.display = mode === 'folder' ? '' : 'none'; document.getElementById('catbox-mode-file').classList.toggle('active-mode', mode === 'file'); document.getElementById('catbox-mode-folder').classList.toggle('active-mode', mode === 'folder'); // reset state selectedCatboxFile = null; let btn = document.getElementById('catbox-upload-btn'); btn.disabled = true; btn.style.background = '#555'; btn.style.color = '#aaa'; document.getElementById('catbox-result').style.display = 'none'; document.getElementById('catbox-status').innerText = ''; if (mode === 'file') document.getElementById('catbox-file-name').innerText = 'Click to select a file'; if (mode === 'folder') document.getElementById('catbox-folder-name').innerText = 'Click to select a folder'; } function handleCatboxSelect(e) { if (e.target.files.length > 0) { selectedCatboxFile = e.target.files[0]; document.getElementById('catbox-file-name').innerText = selectedCatboxFile.name; _catboxEnableBtn(); document.getElementById('catbox-result').style.display = 'none'; document.getElementById('catbox-status').innerText = ''; } } function handleCatboxFolderSelect(e) { const files = e.target.files; if (!files.length) return; const folderName = files[0].webkitRelativePath.split('/')[0] || 'folder'; document.getElementById('catbox-folder-name').innerText = `"${folderName}" — ${files.length} file(s) selected (will be zipped)`; // Store the FileList for later zipping document.getElementById('catbox-folder').dataset.ready = '1'; _catboxEnableBtn(); document.getElementById('catbox-result').style.display = 'none'; document.getElementById('catbox-status').innerText = ''; } function _catboxEnableBtn() { let btn = document.getElementById('catbox-upload-btn'); btn.disabled = false; btn.style.background = '#4fc7ff'; btn.style.color = '#000'; btn.innerText = 'Upload'; } function _catboxSetStatus(msg, color) { let el = document.getElementById('catbox-status'); el.innerText = msg; el.style.color = color || '#aaa'; } async function _buildUploadFile() { if (catboxMode === 'file') { return selectedCatboxFile; } // Folder mode — zip with JSZip const fileInput = document.getElementById('catbox-folder'); const files = fileInput.files; if (!files.length) return null; _catboxSetStatus('Zipping folder…', '#f0c040'); // Lazy-load JSZip from CDN if (!window.JSZip) { await new Promise((res, rej) => { const s = document.createElement('script'); s.src = 'https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js'; s.onload = res; s.onerror = rej; document.head.appendChild(s); }); } const zip = new JSZip(); for (const file of files) { zip.file(file.webkitRelativePath || file.name, file); } const blob = await zip.generateAsync({ type: 'blob', compression: 'DEFLATE', compressionOptions: { level: 6 } }); const folderName = files[0].webkitRelativePath.split('/')[0] || 'folder'; return new File([blob], folderName + '.zip', { type: 'application/zip' }); } async function uploadToCatbox() { let btn = document.getElementById('catbox-upload-btn'); btn.disabled = true; btn.innerText = 'Uploading…'; document.getElementById('catbox-result').style.display = 'none'; let fileToUpload; try { fileToUpload = await _buildUploadFile(); } catch (err) { _catboxSetStatus('Failed to zip folder: ' + err.message, '#ff6b6b'); btn.disabled = false; btn.innerText = 'Upload'; return; } if (!fileToUpload) { _catboxSetStatus('No file selected.', '#ff6b6b'); btn.disabled = false; btn.innerText = 'Upload'; return; } // ── Try Catbox.moe first ── _catboxSetStatus('Trying Catbox.moe…', '#aaa'); try { const fd = new FormData(); fd.append('reqtype', 'fileupload'); fd.append('fileToUpload', fileToUpload); const res = await fetch('https://catbox.moe/user/api.php', { method: 'POST', body: fd, mode: 'cors' }); if (!res.ok) throw new Error('HTTP ' + res.status); const url = (await res.text()).trim(); if (!url.startsWith('http')) throw new Error('Unexpected response: ' + url); _catboxSetStatus('✓ Uploaded via Catbox.moe (permanent link)', '#4fc7ff'); document.getElementById('catbox-provider-label').innerText = 'Catbox.moe (permanent)'; document.getElementById('catbox-link').innerText = url; document.getElementById('catbox-result').style.display = 'block'; btn.innerText = 'Upload Again'; btn.disabled = false; return; } catch (e) { _catboxSetStatus('Catbox.moe blocked/unavailable. Trying tmpfiles.org…', '#f0c040'); } // ── Fallback: tmpfiles.org ── try { const fd2 = new FormData(); fd2.append('file', fileToUpload); const res2 = await fetch('https://tmpfiles.org/api/v1/upload', { method: 'POST', body: fd2 }); if (!res2.ok) throw new Error('HTTP ' + res2.status); const json = await res2.json(); // tmpfiles returns { status: 'success', data: { url: 'https://tmpfiles.org/...' } } if (json.status !== 'success') throw new Error(json.message || 'Unknown error'); const rawUrl = json.data.url; // Convert view URL to direct download URL: tmpfiles.org/1234/file.jpg -> tmpfiles.org/dl/1234/file.jpg const dlUrl = rawUrl.replace('tmpfiles.org/', 'tmpfiles.org/dl/'); _catboxSetStatus('✓ Uploaded via tmpfiles.org (expires in 60 min)', '#a78bfa'); document.getElementById('catbox-provider-label').innerText = 'tmpfiles.org (expires in 60 minutes)'; document.getElementById('catbox-link').innerText = dlUrl; document.getElementById('catbox-result').style.display = 'block'; btn.innerText = 'Upload Again'; btn.disabled = false; } catch (e2) { _catboxSetStatus('Both services failed. Check your connection and try again.', '#ff6b6b'); btn.disabled = false; btn.innerText = 'Upload'; } } function copyCatboxLink() { const link = document.getElementById('catbox-link').innerText; if (navigator.clipboard && window.isSecureContext) { navigator.clipboard.writeText(link).then(() => { _catboxSetStatus('✓ Link copied to clipboard!', '#4fc7ff'); }).catch(() => { _catboxSetStatus('Could not copy — please copy manually.', '#ff6b6b'); }); } else { try { const textArea = document.createElement("textarea"); textArea.value = link; textArea.style.position = "fixed"; textArea.style.opacity = "0"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); document.execCommand('copy'); textArea.remove(); _catboxSetStatus('✓ Link copied to clipboard!', '#4fc7ff'); } catch (err) { _catboxSetStatus('Could not copy — please copy manually.', '#ff6b6b'); } } } // Image Converter Logic let selectedImgFile = null; let selectedImgFiles = []; let imgNaturalW = 0, imgNaturalH = 0; function handleImgConvSelect(e) { if (!e.target.files.length) return; selectedImgFiles = Array.from(e.target.files); selectedImgFile = selectedImgFiles[0]; const nameLabel = selectedImgFiles.length > 1 ? `${selectedImgFiles.length} images selected` : selectedImgFile.name; document.getElementById('img-conv-name').innerText = nameLabel; // Load first image to get natural dimensions const url = URL.createObjectURL(selectedImgFile); const tmp = new Image(); tmp.onload = function () { imgNaturalW = tmp.naturalWidth; imgNaturalH = tmp.naturalHeight; URL.revokeObjectURL(url); // Pre-fill resize inputs with first image size document.getElementById('img-width').value = imgNaturalW; document.getElementById('img-height').value = imgNaturalH; // Show controls document.getElementById('img-resize-row').style.display = ''; document.getElementById('img-size-info').style.display = ''; const totalSize = selectedImgFiles.reduce((s, f) => s + f.size, 0); document.getElementById('img-orig-info').innerText = selectedImgFiles.length > 1 ? `${selectedImgFiles.length} images • Total: ${_fmtBytes(totalSize)}` : `Original: ${imgNaturalW} × ${imgNaturalH} px • ${_fmtBytes(selectedImgFile.size)}`; imgConvEstimate(); imgConvUpdateQualityUI(); }; tmp.src = url; let btn = document.getElementById('img-conv-btn'); btn.disabled = false; btn.style.background = '#4fc7ff'; btn.style.color = '#000'; } function imgConvUpdateQualityUI() { const fmt = document.getElementById('img-conv-format').value; const isPDF = fmt === 'pdf'; const isLossy = fmt === 'image/jpeg' || fmt === 'image/webp'; document.getElementById('img-quality-row').style.display = isLossy ? '' : 'none'; document.getElementById('img-resize-row').style.display = isPDF ? 'none' : (selectedImgFile ? '' : 'none'); document.getElementById('img-pdf-border-row').style.display = isPDF ? '' : 'none'; // Update button label document.getElementById('img-conv-btn').textContent = isPDF ? 'Export as PDF' : 'Convert & Download'; imgConvEstimate(); } function imgConvSyncDim(changed) { if (!document.getElementById('img-aspect-lock').checked) { imgConvEstimate(); return; } if (!imgNaturalW || !imgNaturalH) return; const ratio = imgNaturalW / imgNaturalH; if (changed === 'w') { const w = parseInt(document.getElementById('img-width').value); if (!isNaN(w) && w > 0) document.getElementById('img-height').value = Math.round(w / ratio); } else { const h = parseInt(document.getElementById('img-height').value); if (!isNaN(h) && h > 0) document.getElementById('img-width').value = Math.round(h * ratio); } imgConvEstimate(); } function imgConvResetDims() { document.getElementById('img-width').value = imgNaturalW; document.getElementById('img-height').value = imgNaturalH; imgConvEstimate(); } // Rough size estimate using a small thumb canvas function imgConvEstimate() { if (!selectedImgFile || !imgNaturalW) return; const fmt = document.getElementById('img-conv-format').value; const quality = parseInt(document.getElementById('img-quality').value) / 100; const w = parseInt(document.getElementById('img-width').value) || imgNaturalW; const h = parseInt(document.getElementById('img-height').value) || imgNaturalH; // Draw a tiny thumb for quick estimation const scale = Math.min(1, 80 / Math.max(w, h)); const thumbW = Math.round(w * scale); const thumbH = Math.round(h * scale); const tmpCvs = document.createElement('canvas'); tmpCvs.width = thumbW; tmpCvs.height = thumbH; const tmpCtx = tmpCvs.getContext('2d'); const url = URL.createObjectURL(selectedImgFile); const img = new Image(); img.onload = function () { tmpCtx.drawImage(img, 0, 0, thumbW, thumbH); URL.revokeObjectURL(url); // Extrapolate thumb dataURL size to full size const thumbDataUrl = tmpCvs.toDataURL(fmt, quality); const thumbB64Bytes = (thumbDataUrl.length - thumbDataUrl.indexOf(',') - 1) * 0.75; const estBytes = thumbB64Bytes / (scale * scale); const ext = fmt.split('/')[1].toUpperCase(); document.getElementById('img-out-info').innerText = `Output (~${ext}): ${w} × ${h} px • ~${_fmtBytes(estBytes)}`; }; img.src = url; } function _fmtBytes(b) { if (b >= 1048576) return (b / 1048576).toFixed(1) + ' MB'; if (b >= 1024) return (b / 1024).toFixed(0) + ' KB'; return Math.round(b) + ' B'; } function convertImage() { if (!selectedImgFile) return; const fmt = document.getElementById('img-conv-format').value; if (fmt === 'pdf') { _exportImagesToPDF(); return; } const quality = parseInt(document.getElementById('img-quality').value) / 100; const isLossy = fmt === 'image/jpeg' || fmt === 'image/webp'; const ext = fmt.split('/')[1]; const targetW = parseInt(document.getElementById('img-width').value) || imgNaturalW; const targetH = parseInt(document.getElementById('img-height').value) || imgNaturalH; const reader = new FileReader(); reader.onload = function (event) { const img = new Image(); img.onload = function () { const canvas = document.getElementById('img-conv-canvas'); canvas.width = targetW; canvas.height = targetH; const ctx = canvas.getContext('2d'); // Fill white background for JPEG (no alpha channel) if (fmt === 'image/jpeg') { ctx.fillStyle = '#ffffff'; ctx.fillRect(0, 0, targetW, targetH); } ctx.drawImage(img, 0, 0, targetW, targetH); const dataUrl = isLossy ? canvas.toDataURL(fmt, quality) : canvas.toDataURL(fmt); const baseName = selectedImgFile.name.replace(/\.[^.]+$/, ''); const suffix = (targetW !== imgNaturalW || targetH !== imgNaturalH) ? `_${targetW}x${targetH}` : ''; const a = document.createElement('a'); a.href = dataUrl; a.download = `${baseName}${suffix}.${ext}`; a.click(); }; img.src = event.target.result; }; reader.readAsDataURL(selectedImgFile); } // ── PDF Export ────────────────────────────────────────────────── function _exportImagesToPDF() { const files = selectedImgFiles.length ? selectedImgFiles : [selectedImgFile]; const addBorders = document.getElementById('img-pdf-borders').checked; const btn = document.getElementById('img-conv-btn'); btn.textContent = 'Generating PDF…'; btn.disabled = true; // Load jsPDF dynamically if not already loaded function _doExport(jsPDF) { // First pass: load all images to find max dims const imgs = []; let loaded = 0; files.forEach((file, i) => { const url = URL.createObjectURL(file); const img = new Image(); img.onload = function () { imgs[i] = { img, w: img.naturalWidth, h: img.naturalHeight, url }; loaded++; if (loaded === files.length) _buildPDF(jsPDF, imgs, addBorders, files[0].name); }; img.onerror = function () { imgs[i] = null; loaded++; URL.revokeObjectURL(url); if (loaded === files.length) _buildPDF(jsPDF, imgs, addBorders, files[0].name); }; img.src = url; }); } function _buildPDF(jsPDF, imgs, addBorders, firstName) { const validImgs = imgs.filter(Boolean); if (!validImgs.length) { btn.textContent = 'Export as PDF'; btn.disabled = false; return; } const PX_TO_PT = 0.75; // 1px = 0.75pt at 96dpi // Determine page size let pageW, pageH; if (addBorders) { // Uniform page = largest image + 40px margin each side const PAD = 40; pageW = Math.max(...validImgs.map(o => o.w)) + PAD * 2; pageH = Math.max(...validImgs.map(o => o.h)) + PAD * 2; } let pdf = null; const canvas = document.getElementById('img-conv-canvas'); const ctx = canvas.getContext('2d'); validImgs.forEach((entry, idx) => { const { img, w, h } = entry; let pgW, pgH, imgX, imgY, drawW, drawH; if (addBorders) { pgW = pageW; pgH = pageH; // Centre image on the uniform page drawW = w; drawH = h; imgX = Math.round((pgW - drawW) / 2); imgY = Math.round((pgH - drawH) / 2); } else { pgW = w; pgH = h; imgX = 0; imgY = 0; drawW = w; drawH = h; } // Draw to canvas canvas.width = pgW; canvas.height = pgH; ctx.clearRect(0, 0, pgW, pgH); ctx.fillStyle = '#ffffff'; ctx.fillRect(0, 0, pgW, pgH); ctx.drawImage(img, imgX, imgY, drawW, drawH); URL.revokeObjectURL(entry.url); const dataUrl = canvas.toDataURL('image/jpeg', 0.92); const ptW = pgW * PX_TO_PT; const ptH = pgH * PX_TO_PT; if (!pdf) { pdf = new jsPDF({ orientation: ptW >= ptH ? 'l' : 'p', unit: 'pt', format: [ptW, ptH] }); } else { pdf.addPage([ptW, ptH], ptW >= ptH ? 'l' : 'p'); } pdf.addImage(dataUrl, 'JPEG', 0, 0, ptW, ptH); }); const baseName = firstName.replace(/\.[^.]+$/, ''); pdf.save(`${baseName}.pdf`); btn.textContent = 'Export as PDF'; btn.disabled = false; } if (window.jspdf && window.jspdf.jsPDF) { _doExport(window.jspdf.jsPDF); } else { const script = document.createElement('script'); script.src = 'https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js'; script.onload = () => _doExport(window.jspdf.jsPDF); script.onerror = () => { alert('Failed to load PDF library. Please check your internet connection.'); btn.textContent = 'Export as PDF'; btn.disabled = false; }; document.head.appendChild(script); } } // ── Link Cleaner ────────────────────────────────────────────── const LC_PARAMS = new Set([ // UTM (Google Analytics) 'utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'utm_id', 'utm_source_platform', 'utm_creative_format', 'utm_marketing_tactic', // Facebook / Meta 'fbclid', 'fb_action_ids', 'fb_action_types', 'fb_ref', 'fb_source', '_fbc', '_fbp', // Google Ads 'gclid', 'gclsrc', 'dclid', 'gbraid', 'wbraid', // Microsoft / Bing 'msclkid', // HubSpot '_hsenc', '_hsmi', 'hsCtaTracking', // Mailchimp 'mc_cid', 'mc_eid', // Twitter / X 'twclid', // LinkedIn 'li_fat_id', 'rcm', // Pinterest 'epik', // Snapchat 'ScCid', // TikTok 'ttclid', // Yahoo 'yclid', // Outbrain 'obOrigUrl', // Drip '__s', // Vero 'vero_conv', 'vero_id', // Klaviyo '_kx', // Marketo 'mkt_tok', // ActiveCampaign 'vgo_ee', // Reddit 'rdt_cid', // Common tracking 'ref', 'ref_', 'referrer', 'source', 'campaign', 'trk', 'trkCampaign', 'sid', 'cid', 'eid', 'mid', 'rid', 'uid', 'vid', 'pid', 'affiliate', 'aff', 'partner', 'promo', 'discount', // Amazon 'tag', 'ascsubtag', 'linkCode', 'creativeASIN', 'camp', 'creative', 'adid', 'pd_rd_r', 'pd_rd_w', 'pd_rd_wg', 'pf_rd_m', 'pf_rd_s', 'pf_rd_r', 'pf_rd_t', 'pf_rd_p', 'pf_rd_i', '$dclid', // Share tracking 'igshid', 'igsh', 'si', // Misc 'zanpid', 'origin', 'ml_subscriber', 'ml_subscriber_hash', 'oly_anon_id', 'oly_enc_id', 'rb_clickid', 'taid', 'irclickid', 'clickId', 'afftrack', 'intercom-tour-application-id', ]); function lcCleanUrl(raw) { raw = raw.trim(); if (!raw) return { cleaned: '', removed: [] }; // Prepend https:// if no protocol given let urlStr = raw; if (!/^https?:\/\//i.test(urlStr)) urlStr = 'https://' + urlStr; let url; try { url = new URL(urlStr); } catch (e) { return { cleaned: raw, removed: [] }; } const originalParams = [...url.searchParams.keys()]; let newUrl = new URL(url.origin + url.pathname); // Defaults to stripping all params + hash // ── 1. Intercept Redirect Links ── if (url.host === 'l.facebook.com' && url.searchParams.has('u')) { try { let fUrl = new URL(decodeURIComponent(url.searchParams.get('u'))); url = fUrl; newUrl = new URL(fUrl.origin + fUrl.pathname); } catch (e) { } } else if (url.host === 'href.li') { try { let fUrl = new URL(url.href.split('?')[1]); url = fUrl; newUrl = new URL(fUrl.origin + fUrl.pathname); } catch (e) { } } else if (url.host === 'www.google.com' && url.pathname === '/url' && url.searchParams.has('url')) { try { let fUrl = new URL(url.searchParams.get('url')); url = fUrl; newUrl = new URL(fUrl.origin + fUrl.pathname); } catch (e) { } } else if (url.host === 'cts.businesswire.com' && url.searchParams.has('url')) { try { let fUrl = new URL(url.searchParams.get('url')); url = fUrl; newUrl = new URL(fUrl.origin + fUrl.pathname); } catch (e) { } } // Helper to preserve specific params const preserve = (k) => { if (url.searchParams.has(k)) newUrl.searchParams.append(k, url.searchParams.get(k)); }; // ── 2. Aggressive Domain-Specific Cleaning ── const h = url.host; if (h === 'play.google.com') { preserve('id'); } else if (h === 'www.macys.com') { preserve('ID'); } else if (h.includes('youtube.com')) { preserve('v'); preserve('t'); if (url.pathname.includes('playlist')) preserve('list'); } else if (h === 'youtu.be') { preserve('t'); } else if (h === 'www.facebook.com' && url.pathname.includes('story.php')) { preserve('story_fbid'); preserve('id'); } else if (h.includes('amazon') && (url.pathname.includes('/dp/') || url.pathname.includes('/d/') || url.pathname.includes('/product/'))) { newUrl.hostname = newUrl.hostname.replace(/^www\./, ''); const match = /(?:\/dp\/|\/product\/|\/d\/)(\w*|\d*)/.exec(url.pathname); if (match && match[1]) newUrl.pathname = '/dp/' + match[1]; } else if (h === 'www.lenovo.com') { preserve('bundleId'); } else if (h === 'www.bestbuy.com' && url.pathname.includes('.p')) { const match = /\/(\d+)\.p/.exec(url.pathname); if (match) newUrl.pathname = '/site/' + match[1] + '.p'; } else if (h === 'www.walmart.com' && url.pathname.includes('/ip/')) { const match = /\/ip\/.*\/(\d+)/.exec(url.pathname); if (match) newUrl.pathname = '/ip/' + match[1]; } else if (h === 'www.xiaohongshu.com') { preserve('xsec_token'); } else if (h === 'weatherkit.apple.com') { preserve('lang'); preserve('party'); preserve('ids'); } else if (h === 'www.webtoons.com') { preserve('title_no'); preserve('episode_no'); } else if (h.includes('linkedin.com') || h.includes('tiktok.com') || h.includes('instagram.com') || h.includes('twitter.com') || h.includes('x.com') || h.includes('daraz.')) { // Specifically aggressively strip ALL query parameters for these highly-shared domains // (They do not need query string to resolve post/profile locations) } else { // ── 3. Universal Fallback / Blacklist for Unknown Domains ── // Rather than breaking random sites (like Google Docs or custom web apps) by aggressively stripping all params, // we restore all safe parameters while removing ONLY the known trackers defined in LC_PARAMS. for (const [k, v] of url.searchParams.entries()) { if (!LC_PARAMS.has(k) && !/^utm_/i.test(k) && !/^fb_/i.test(k)) { newUrl.searchParams.append(k, v); } } if (url.hash) newUrl.hash = url.hash; // Preserve hash for standard sites } // Tally removed parameters purely for UI reporting const finalParams = [...newUrl.searchParams.keys()]; const removed = originalParams.filter(p => !finalParams.includes(p)); return { cleaned: newUrl.toString(), removed }; } function lcClean() { const lines = document.getElementById('lc-input').value.split('\n'); const results = lines.map(l => lcCleanUrl(l)); const nonEmpty = results.filter(r => r.cleaned); if (!nonEmpty.length) { document.getElementById('lc-output-wrap').style.display = 'none'; return; } document.getElementById('lc-output').value = nonEmpty.map(r => r.cleaned).join('\n'); const allRemoved = [...new Set(results.flatMap(r => r.removed))]; const badge = document.getElementById('lc-badge'); badge.textContent = allRemoved.length ? `${allRemoved.length} param(s) removed` : '✓ Already clean'; const removedEl = document.getElementById('lc-removed'); removedEl.innerHTML = allRemoved.length ? 'Removed: ' + allRemoved.map(p => `${p}`).join(' ') : ''; document.getElementById('lc-output-wrap').style.display = ''; } function lcCopy() { const val = document.getElementById('lc-output').value; const successFn = () => { document.getElementById('lc-badge').textContent = '✓ Copied!'; setTimeout(lcClean, 1800); }; if (navigator.clipboard && window.isSecureContext) { navigator.clipboard.writeText(val).then(successFn).catch(e => console.error(e)); } else { try { const t = document.createElement("textarea"); t.value = val; t.style.position = "fixed"; t.style.opacity = "0"; document.body.appendChild(t); t.select(); document.execCommand('copy'); t.remove(); successFn(); } catch (e) { console.error(e); } } } function lcClear() { document.getElementById('lc-input').value = ''; document.getElementById('lc-output-wrap').style.display = 'none'; } // ── Text Sorter ─────────────────────────────────────────────── function tsApply(op) { const el = document.getElementById('ts-input'); const raw = el.value; if (!raw.trim()) return; let lines = raw.split('\n'); let result; switch (op) { case 'az': result = [...lines].sort((a, b) => a.localeCompare(b, undefined, { sensitivity: 'base' })); break; case 'za': result = [...lines].sort((a, b) => b.localeCompare(a, undefined, { sensitivity: 'base' })); break; case 'len-asc': result = [...lines].sort((a, b) => a.length - b.length); break; case 'len-desc': result = [...lines].sort((a, b) => b.length - a.length); break; case 'reverse': result = [...lines].reverse(); break; case 'shuffle': result = [...lines].sort(() => Math.random() - 0.5); break; case 'dedup': result = [...new Map(lines.map(l => [l.trim().toLowerCase(), l])).values()]; break; case 'trim': result = lines.map(l => l.trim()); break; default: result = lines; } const out = result.join('\n'); el.value = out; const badge = document.getElementById('ts-badge'); badge.textContent = result.length + ' line(s)'; badge.style.display = 'inline-block'; } function tsCopy() { const val = document.getElementById('ts-input').value; if (!val) return; const successFn = () => { const badge = document.getElementById('ts-badge'); const oldText = badge.textContent; badge.textContent = '✓ Copied!'; badge.style.display = 'inline-block'; setTimeout(() => { const currentLines = document.getElementById('ts-input').value.split('\n').filter(l => l).length; badge.textContent = currentLines + ' line(s)'; }, 1800); }; if (navigator.clipboard && window.isSecureContext) { navigator.clipboard.writeText(val).then(successFn).catch(e => console.error(e)); } else { try { const t = document.createElement("textarea"); t.value = val; t.style.position = "fixed"; t.style.opacity = "0"; document.body.appendChild(t); t.select(); document.execCommand('copy'); t.remove(); successFn(); } catch (e) { console.error(e); } } } function tsClear() { document.getElementById('ts-input').value = ''; document.getElementById('ts-badge').style.display = 'none'; document.getElementById('ts-input').focus(); }

Support my work

Send Money



Donation Platforms


also buy a service or product!

Choose Support Method

Social


more links

Kept the duck because it's cute

And this is my pet Quail
click to see more Quail
(still kicking and flapping)