https://stackoverflow.com/a/72226248
=filter(mainRange, not(iferror( match(mainRange,exclusionRange,0), false )), mainRange<>"")
| # Include this in your bash profile with: | |
| # source "/path/prompt-colours.sh" | |
| # ------- | |
| # Colours | |
| # ------- | |
| # Reset | |
| NC='\033[0m' # Text Reset |
| <? | |
| function isNewSession() { | |
| if(session_id() == '' || !isset($_SESSION) || session_status() === PHP_SESSION_NONE) { | |
| // session isn't started | |
| session_set_cookie_params(3600,"/"); // 1 hour | |
| session_start(); | |
| } | |
| if (!isset($_SESSION['new_session'])) { | |
| $_SESSION['new_session'] = true; |
| body { | |
| background: #222; | |
| } | |
| .btn { | |
| position: relative; | |
| display: inline-block; | |
| background: transparent; | |
| color: gold; | |
| border: 2px solid; |
| [data-peekaboo="fadeinup"] { | |
| transition: 1.5s ease; | |
| transition-property: opacity, transform; | |
| // Animations runs automatically if there's no JS | |
| &:not(.visible, html.no-js *) { | |
| opacity: 0; | |
| transform: translateY(1em); | |
| } | |
| } |
https://stackoverflow.com/a/72226248
=filter(mainRange, not(iferror( match(mainRange,exclusionRange,0), false )), mainRange<>"")
| // Originally from Jhey: https://twitter.com/jh3yy/status/1793628022245150752 | |
| // I found from https://www.amitmerchant.com/little-devtools-snippet-to-check-broken-links-on-a-webpage/ | |
| // I added the a in the a[href] selector to avoid svg use elements | |
| // 1. Run this in dev tools | |
| // 2. Check the network tab (filter by Fetch/XHR) - see if there are any errors | |
| // 3. Repeat for each page | |
| $$('a[href]:not([href=""])').forEach(anchor => { | |
| console.info({ anchor, href: anchor.href }) | |
| fetch(anchor.href, { method: 'HEAD' }) |
| <!-- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#preload --> | |
| <video muted preload="metadata"> | |
| <source src="/blah.mp4" type="video/mp4"> | |
| </video> |
| // https://stackoverflow.com/a/57748743 | |
| document.documentElement.style.setProperty('--scrollbar-width', (window.innerWidth - document.documentElement.clientWidth) + "px"); |
| on run {input, parameters} | |
| set {year:y, month:m, day:d} to (current date) | |
| # pad the day and month if single digit | |
| set day_str to text -1 thru -2 of ("00" & d) | |
| set mon_str to text -1 thru -2 of ("00" & (m * 1)) | |
| # make ISO8601 date string without time | |
| set thedate to (y & "-" & mon_str & "-" & day_str) as string | |
| tell application "System Events" | |
| keystroke thedate |
| sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder |