git checkout -b branchname <sha1-of-commit or HEAD~3>
Mainly used if a remote repository name has changed.
git remote set-url origin {new-url}
/*----------------------- | |
Offset | |
--- | |
Get the offset of an element on the page relative to the document. | |
-----------------------*/ | |
function offset(el) { | |
const rect = el.getBoundingClientRect(), | |
scrollTop = window.pageYOffset || document.documentElement.scrollTop; | |
return { top: rect.top + scrollTop, bottom: rect.bottom + scrollTop }; |
<?php | |
/*----------------------------- | |
Notes | |
- After running the script then remove the "ID" and "_valid" keys from all fields in the json output. These are extraneous and may cause import errors. | |
Resource - https://dev-notes.eu/2017/01/convert-acf-fields-registered-by-php-to-importable-json-format/ | |
-----------------------------*/ | |
$groups = acf_get_local_field_groups(); |
.underline-text { | |
display: inline-block; | |
position: relative; | |
text-decoration: none; | |
/* This is the key. The lines that this border applies to must be 'inline'. */ | |
display: inline; | |
background-image: linear-gradient(to bottom, transparent 20%, #00e692 21%); | |
/* This ensures the line appears at the right vertical position on each line. 1em will correspond exactly to the height of the font. */ | |
background-position: 0 1em; | |
background-repeat: no-repeat; |
<div class="product_card"> | |
<div class="product_image" style="background-image: url('https://celsowhite.com/static/img/about/me.jpg')"> | |
<!-- Important: Any content in this proportional div must be positioned absolute so it adapts to the container proportions. --> | |
</div> | |
<div class="product_info"> | |
<h2>Celso</h2> | |
</div> | |
</div> |
# Force all www to redirect to non-www | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^www\.example\.com$ | |
RewriteRule ^/?$ "https\:\/\/example\.com\/" [R=301,L] | |
# Force all http to redirect to https | |
RewriteEngine On | |
RewriteCond %{HTTPS} off |
// Sort a plain list of names alphabetically. | |
const people = ` | |
Mike Dobbs | |
Peace Walker | |
Adam Vinson | |
`; | |
// Convert the list to an array. Splitting on the new line. |
/*================================= | |
Animate In View | |
=================================*/ | |
// Elements | |
const animatedElements = document.querySelectorAll('.animate_in_view'); | |
// Check position of each element on scroll and animate |
<div class="notification_banner dismissible" id="store_locator_notification"> | |
<p>Notification Content</p> | |
<div class="notification_dismiss_button" data-dismiss="store_locator_notification"> | |
<i class="fas fa-times"></i> | |
</div> | |
</div> |
/*================================== | |
Lists | |
--- | |
General ul and ol elements within wysiwyg content areas having specific bullet or numbered styling. | |
The below styles create custom bullets and numbered lists. Bullets can be any image or unicode. Numbers can have a specific font style. | |
==================================*/ | |
ul, ol { | |
margin: 0; | |
padding: 0; |