This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Convert a Date into XML Schema (ISO 8601) format. | |
#2022-11-06T06:24:46-08:00 | |
date -u +%FT%T%z | |
#2023-03-21T20:40:35+0000 | |
date -u '+%Y-%m-%dT%k:%M:%S%z' | |
#2023-03-21T20:41:13+0000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const birthday_input = document.querySelector("#birthnumber"); | |
const BIRTHNUMBER_ALLOWED_CHARS_REGEXP = /[A-Za-z0-9_-]+/; | |
birthday_input.addEventListener("beforeinput", e => { | |
if (!BIRTHNUMBER_ALLOWED_CHARS_REGEXP.test(e.data)) { | |
e.preventDefault(); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function scrollToTargetAdjusted(){ | |
var element = document.getElementById('targetElement'); | |
var headerOffset = 45; | |
var elementPosition = element.getBoundingClientRect().top; | |
var offsetPosition = elementPosition + window.pageYOffset - headerOffset; | |
window.scrollTo({ | |
top: offsetPosition, | |
behavior: "smooth" | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getURLParameters() { | |
let urlString = window.location.href; | |
let paramString = urlString.split('?')[1]; | |
let params_arr = paramString.split('&'); | |
for (let i = 0; i < params_arr.length; i++) { | |
let pair = params_arr[i].split('='); | |
console.log("Key is:" + pair[0]); | |
console.log("Value is:" + pair[1]); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Vars | |
// ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ | |
const search_input = document.getElementById('product-search_input'); | |
const search_products = document.querySelectorAll('data-product'); | |
const searchVis = function (query, data) { | |
for (let i = 0; i < data.length; i++) { | |
if (!query || data[i].getAttribute('title').toLowerCase().indexOf(query) > -1) { | |
data[i].style['display'] = 'inline'; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Listing all Installed Non-Cask Homebrew Formulas | |
# If you are only looking to get all non-Cask top-level formulas and do not want to install | |
# a dependency just to obtain said list (e.g.: brew bundle dump). Use the following: | |
brew leaves | xargs -n1 brew desc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* get_estimated_reading_time --- Get estimated reading time in minutes | |
* @author Vincent V. Toscano | |
* Created by Vincent on Oct. 19, 2020 | |
* Updated Oct. 20, 2020 | |
* Ref.: get_the_content https://developer.wordpress.org/reference/functions/get_the_content/ | |
* Ref.: strip_shortcodes https://developer.wordpress.org/reference/functions/strip_shortcodes/ | |
* Ref.: strip_tags https://www.php.net/manual/en/function.strip-tags.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* getUsersLocalTimestamp --- Get User’s local timestamp for inclusion on strings sent to backend. | |
* @returns {string} "2020-06-03 @ 12:12:25" | |
* @usage getUsersLocalTimestamp() | |
*/ | |
function getUsersLocalTimestamp() { | |
let date = new Date(); | |
let yyyy = date.getFullYear().toString(); | |
let mm = (date.getMonth() + 1).toString(); | |
let dd = date.getDate().toString(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
background: linear-gradient(307deg, #153cdb, #006aff, #06348a); | |
background-size: 600% 600%; | |
-webkit-animation: blueTide 17s ease infinite; | |
-moz-animation: blueTide 17s ease infinite; | |
-o-animation: blueTide 17s ease infinite; | |
animation: blueTide 17s ease infinite; | |
@-webkit-keyframes blueTide { | |
0%{background-position:0% 51%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Vincent V. Toscano | |
* Safari redraw fix --- Must be placed after the element is available. | |
* Notes: | |
* 1. Solution to the issue where Safari will not show animated SVG sprite sheet used as a background image of element until | |
* until the user interacts with the page/element. | |
* 2. This has been tested on Safari 6 - 7.1.3 | |
* 3. Adjust timing to suite your needs | |
* 4. Enact this technique only once for any element that will not show/present on screen. | |
*/ |