This is a simplified example of Smarter Link Underlines built for Sass rather than Stylus. Original code example by Adam Schwartz of eager.io.
View a live example on Codepen
This is a simplified example of Smarter Link Underlines built for Sass rather than Stylus. Original code example by Adam Schwartz of eager.io.
View a live example on Codepen
<?php | |
// Drop this into your functions.php | |
/** | |
* ACF: Keep the last edited tab selection when post refreshes. | |
* | |
* When a post containing ACF tabs is opened for edits, the currently selected tab | |
* will be saved in a transient. Upon save or refresh of the page, the last selected | |
* tab will be selected again, making it more convenient to work with ACF tabs. |
Before getting into the matter, I wanted to set the stage. We are essentially going to talk about three things today.
How to have some fun using the terminal.
sudo apt-get install cowsay
sudo apt-get install fortune
sudo apt-get install figlet
ruby -v
gem install lolcat
<?php | |
# Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication | |
# http://creativecommons.org/publicdomain/zero/1.0/ | |
function postToMedium($data=array()) { | |
$user_id = "XXXX"; | |
$accessToken = "XXXX"; | |
<?php | |
//ini_set('display_errors',1); | |
//error_reporting(E_ALL | E_WARNING); | |
function is_valid_url($url){ | |
$url = filter_var($url, FILTER_SANITIZE_URL); | |
return filter_var($url, FILTER_VALIDATE_URL); | |
} | |
/* RUNTIME */ |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent