List of helpful shortcuts for faster coding
If you have any other helpful shortcuts, feel free to add in the comments of this gist :)
(function ($) { | |
var _loadThen = $.fn.loadThen; | |
/** | |
* An alternative to jQuery's ajax load() function that has the same interface | |
* except it does not take a callback function, but instead it returns a promise. | |
* The promise will be resolved when the content are loaded into the set of matched elements. | |
* @param url {string} A string containing the URL to which the request is sent. | |
* @param params {object or string} A plain object or string that is sent to the server with the request. | |
* @returns {jQuery Promise} with params (html, status, jqXHR). |
{"lastUpload":"2020-12-13T04:12:16.517Z","extensionVersion":"v3.4.3"} |
<nav> | |
<ul> | |
<li><a href="/">Home</a></li> | |
<li><a href="/about/">About</a></li> | |
<li><a href="/clients/">Clients</a></li> | |
<li><a href="/contact/">Contact Us</a></li> | |
</ul> | |
</nav> | |
<script> |
/* =============== | |
MIXINS | |
=============== */ | |
@mixin spacingUtilites($spacers, $directions, $breakpoints) { | |
@each $breakpoint_name, $breakpoint in $breakpoints { | |
@if ($breakpoint == 0) { | |
$breakpoint_name: ""; | |
@include spacingProperties($spacers, $directions, $breakpoint_name); | |
} @else { |
/* =============== | |
MIXINS | |
=============== */ | |
@mixin flexProperties($prefix) { | |
.d#{$prefix}-flex { | |
display: flex !important; | |
} | |
.flex#{$prefix}-row { | |
flex-direction: row !important; | |
} |
function fa_icons() { | |
return array ( | |
'fab fa-500px' => __( '500px', 'buildr' ), | |
'fab fa-accessible-icon' => __( 'accessible-icon', 'buildr' ), | |
'fab fa-accusoft' => __( 'accusoft', 'buildr' ), | |
'fas fa-address-book' => __( 'address-book', 'buildr' ), | |
'far fa-address-book' => __( 'address-book', 'buildr' ), | |
'fas fa-address-card' => __( 'address-card', 'buildr' ), | |
'far fa-address-card' => __( 'address-card', 'buildr' ), |
{ | |
"fas fa-address-book","fas fa-address-card","fas fa-adjust","fas fa-align-center","fas fa-align-justify","fas fa-align-left","fas fa-align-right","fas fa-allergies","fas fa-ambulance","fas fa-american-sign-language-interpreting","fas fa-anchor","fas fa-angle-double-down","fas fa-angle-double-left","fas fa-angle-double-right","fas fa-angle-double-up","fas fa-angle-down","fas fa-angle-left","fas fa-angle-right","fas fa-angle-up","fas fa-archive","fas fa-arrow-alt-circle-down","fas fa-arrow-alt-circle-left","fas fa-arrow-alt-circle-right","fas fa-arrow-alt-circle-up","fas fa-arrow-circle-down","fas fa-arrow-circle-left","fas fa-arrow-circle-right","fas fa-arrow-circle-up","fas fa-arrow-down","fas fa-arrow-left","fas fa-arrow-right","fas fa-arrow-up","fas fa-arrows-alt","fas fa-arrows-alt-h","fas fa-arrows-alt-v","fas fa-assistive-listening-systems","fas fa-asterisk","fas fa-at","fas fa-audio-description","fas fa-backward","fas fa-balance-scale","fas fa-ban","fas fa-band-aid","fas fa-barcode","fas fa-bars", |
function formatBytes(a,b=2){if(0===a)return"0 Bytes";const c=0>b?0:b,d=Math.floor(Math.log(a)/Math.log(1024));return parseFloat((a/Math.pow(1024,d)).toFixed(c))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][d]} |