Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Directing projects

Vincent V. Toscano VincentVToscano

💭
Directing projects
View GitHub Profile
@VincentVToscano
VincentVToscano / SafariSVGBackgrounRedrawFix.js
Last active Aug 29, 2015
Safari 6 - 7.1.3 SVG Background Redraw Fix
View SafariSVGBackgrounRedrawFix.js
/**
* 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.
*/
@VincentVToscano
VincentVToscano / animatedGradient.css
Last active May 9, 2020
Moves shades of blue across an element of choice
View animatedGradient.css
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%}
@VincentVToscano
VincentVToscano / getUsersLocalTimestamp.js
Created Jun 3, 2020
Get User’s local timestamp that can be utilized client or for inclusion on strings to be sent to backend.
View getUsersLocalTimestamp.js
/**
* 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();
@VincentVToscano
VincentVToscano / get_estimated_reading_time.php
Last active Oct 20, 2020
Get the estimated reading time of an article, blog post, or custom post in WordPress
View get_estimated_reading_time.php
<?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