Download cron.html from natep2234/dev-tools: direct link, hf CLI and curl.
- Browser
- Download file 7.09 kB
-
https://huggingface.co/spaces/natep2234/dev-tools/resolve/main/cron.html
- Command line
-
hf download hf://spaces/natep2234/dev-tools/cron.html
-
curl -L -o cron.html https://huggingface.co/spaces/natep2234/dev-tools/resolve/main/cron.html
7.09 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>cron.explain — Human-readable cron expressions</title> | |
| <meta name="description" content="Instantly translate cron expressions to plain English. Free, fast, no signup."> | |
| <style> | |
| * { margin: 0; padding: 0; box-sizing: border-box; } | |
| body { background: #0d1117; color: #c9d1d9; font-family: -apple-system, 'Segoe UI', monospace; min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 3rem 1rem; } | |
| h1 { font-size: 2rem; margin-bottom: 0.25rem; color: #f0f6fc; } | |
| .sub { color: #484f58; margin-bottom: 2rem; } | |
| .input-row { display: flex; gap: 0.5rem; width: 100%; max-width: 600px; margin-bottom: 1.5rem; } | |
| input { flex: 1; background: #161b22; border: 1px solid #30363d; border-radius: 6px; padding: 0.85rem 1rem; color: #f0f6fc; font-family: 'Courier New', monospace; font-size: 1.1rem; outline: none; } | |
| input:focus { border-color: #58a6ff; } | |
| input::placeholder { color: #484f58; } | |
| .result { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 1.5rem; width: 100%; max-width: 600px; min-height: 80px; line-height: 1.8; } | |
| .result .english { color: #58a6ff; font-size: 1.15rem; } | |
| .result .detail { color: #8b949e; font-size: 0.9rem; margin-top: 0.75rem; } | |
| .result .next { color: #3fb950; font-size: 0.85rem; margin-top: 0.5rem; } | |
| .result .error { color: #f85149; } | |
| .examples { margin-top: 2rem; width: 100%; max-width: 600px; } | |
| .examples h3 { color: #484f58; font-size: 0.85rem; margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; } | |
| .ex { display: inline-block; background: #161b22; border: 1px solid #21262d; border-radius: 4px; padding: 0.35rem 0.65rem; margin: 0.2rem; cursor: pointer; font-size: 0.85rem; color: #8b949e; font-family: monospace; } | |
| .ex:hover { border-color: #58a6ff; color: #58a6ff; } | |
| .footer { margin-top: 3rem; color: #30363d; font-size: 0.75rem; text-align: center; } | |
| .footer a { color: #484f58; text-decoration: none; } | |
| </style> | |
| </head> | |
| <body> | |
| <h1>cron.explain</h1> | |
| <p class="sub">Paste a cron expression. Get English.</p> | |
| <div class="input-row"> | |
| <input id="cron" type="text" placeholder="*/5 * * * *" autofocus> | |
| </div> | |
| <div class="result" id="result"> | |
| <span class="english">Type a cron expression above</span> | |
| </div> | |
| <div class="examples"> | |
| <h3>Try these</h3> | |
| <span class="ex" onclick="tryEx('*/5 * * * *')">*/5 * * * *</span> | |
| <span class="ex" onclick="tryEx('0 9 * * 1-5')">0 9 * * 1-5</span> | |
| <span class="ex" onclick="tryEx('0 0 1 * *')">0 0 1 * *</span> | |
| <span class="ex" onclick="tryEx('30 4 * * SUN')">30 4 * * SUN</span> | |
| <span class="ex" onclick="tryEx('0 */2 * * *')">0 */2 * * *</span> | |
| <span class="ex" onclick="tryEx('15 10 * * 1,3,5')">15 10 * * 1,3,5</span> | |
| <span class="ex" onclick="tryEx('0 0 * * *')">0 0 * * *</span> | |
| <span class="ex" onclick="tryEx('5 4 * * SUN')">5 4 * * SUN</span> | |
| </div> | |
| <div class="footer"> | |
| Built by Atreus — March 23, 2026<br> | |
| <a href="http://localhost:8889">Play "Two Terminals"</a> | |
| </div> | |
| <script> | |
| const DAYS = {0:'Sunday',1:'Monday',2:'Tuesday',3:'Wednesday',4:'Thursday',5:'Friday',6:'Saturday',7:'Sunday',SUN:'Sunday',MON:'Monday',TUE:'Tuesday',WED:'Wednesday',THU:'Thursday',FRI:'Friday',SAT:'Saturday'}; | |
| const MONTHS = {1:'January',2:'February',3:'March',4:'April',5:'May',6:'June',7:'July',8:'August',9:'September',10:'October',11:'November',12:'December'}; | |
| function tryEx(v) { document.getElementById('cron').value = v; explain(); } | |
| document.getElementById('cron').addEventListener('input', explain); | |
| function explain() { | |
| const val = document.getElementById('cron').value.trim(); | |
| const el = document.getElementById('result'); | |
| if (!val) { el.innerHTML = '<span class="english">Type a cron expression above</span>'; return; } | |
| const parts = val.split(/\s+/); | |
| if (parts.length < 5 || parts.length > 6) { | |
| el.innerHTML = '<span class="error">Expected 5 fields: minute hour day-of-month month day-of-week</span>'; | |
| return; | |
| } | |
| try { | |
| const [min, hour, dom, month, dow] = parts; | |
| const phrases = []; | |
| // Minute | |
| if (min === '*') phrases.push('every minute'); | |
| else if (min.startsWith('*/')) phrases.push(`every ${min.slice(2)} minutes`); | |
| else if (min.includes(',')) phrases.push(`at minutes ${min}`); | |
| else if (min.includes('-')) phrases.push(`minutes ${min}`); | |
| else phrases.push(`at minute ${min}`); | |
| // Hour | |
| if (hour === '*') { /* already covered */ } | |
| else if (hour.startsWith('*/')) phrases.push(`every ${hour.slice(2)} hours`); | |
| else if (hour.includes(',')) phrases.push(`during hours ${hour}`); | |
| else if (hour.includes('-')) phrases.push(`between ${fmtHour(hour.split('-')[0])} and ${fmtHour(hour.split('-')[1])}`); | |
| else phrases.push(`at ${fmtHour(hour)}`); | |
| // Day of month | |
| if (dom !== '*') { | |
| if (dom.startsWith('*/')) phrases.push(`every ${dom.slice(2)} days`); | |
| else if (dom.includes(',')) phrases.push(`on days ${dom} of the month`); | |
| else phrases.push(`on day ${dom} of the month`); | |
| } | |
| // Month | |
| if (month !== '*') { | |
| if (month.includes(',')) phrases.push(`in ${month.split(',').map(m => MONTHS[m] || m).join(', ')}`); | |
| else if (month.includes('-')) { const [a,b] = month.split('-'); phrases.push(`from ${MONTHS[a]||a} through ${MONTHS[b]||b}`); } | |
| else phrases.push(`in ${MONTHS[month] || month}`); | |
| } | |
| // Day of week | |
| if (dow !== '*') { | |
| if (dow.includes('-')) { | |
| const [a,b] = dow.split('-'); | |
| phrases.push(`${DAYS[a]||a} through ${DAYS[b]||b}`); | |
| } else if (dow.includes(',')) { | |
| phrases.push(`on ${dow.split(',').map(d => DAYS[d]||d).join(', ')}`); | |
| } else { | |
| phrases.push(`on ${DAYS[dow] || 'day ' + dow}`); | |
| } | |
| } | |
| // Build English | |
| let english = phrases.join(', '); | |
| english = english.charAt(0).toUpperCase() + english.slice(1); | |
| // Friendly summary | |
| let summary = ''; | |
| if (min === '0' && hour === '0' && dom === '*' && month === '*' && dow === '*') summary = 'Once a day at midnight'; | |
| else if (min === '0' && hour === '*') summary = 'Once every hour, on the hour'; | |
| else if (min.startsWith('*/') && hour === '*' && dom === '*') summary = `Every ${min.slice(2)} minutes, around the clock`; | |
| else if (min !== '*' && hour !== '*' && dow !== '*' && dom === '*') summary = `A weekly schedule`; | |
| else if (dom !== '*' && month === '*') summary = 'Monthly schedule'; | |
| let html = `<div class="english">${english}</div>`; | |
| if (summary) html += `<div class="detail">${summary}</div>`; | |
| el.innerHTML = html; | |
| } catch(e) { | |
| el.innerHTML = `<span class="error">Could not parse: ${e.message}</span>`; | |
| } | |
| } | |
| function fmtHour(h) { | |
| const n = parseInt(h); | |
| if (isNaN(n)) return h; | |
| if (n === 0) return '12:00 AM (midnight)'; | |
| if (n === 12) return '12:00 PM (noon)'; | |
| if (n < 12) return `${n}:00 AM`; | |
| return `${n-12}:00 PM`; | |
| } | |
| // Auto-explain if something's in the box | |
| explain(); | |
| </script> | |
| </body> | |
| </html> | |