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}
| import gsap from 'gsap'; | |
| import { ScrollTrigger } from 'gsap/ScrollTrigger'; | |
| function initScrollDirectionIndicator() { | |
| // GSAP Plugins | |
| gsap.registerPlugin(ScrollTrigger); | |
| /*---------------------------- | |
| Elements | |
| ----------------------------*/ |
| import Flickity from 'flickity-fade'; | |
| require('flickity-imagesloaded'); | |
| /** | |
| * Init Flickity | |
| * | |
| * @param node container - The container element node. Flickity gallery and arrows should be within this container. | |
| * @param object flickityOptions - The specific flickity api options for this initialization. | |
| * | |
| * output Sets up a Flickity slider instance with standard slider customizations done via the api. |
| /*------------------------- | |
| Target Blank | |
| --- | |
| Link all external links to a new window. | |
| -------------------------*/ | |
| document.addEventListener('DOMContentLoaded', () => { | |
| for (var c = document.getElementsByTagName('a'), a = 0; a < c.length; a++) { | |
| var b = c[a]; | |
| b.getAttribute('href') && |
| /*----------------------- | |
| 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. |