This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {AxiosError} from "axios"; | |
| export function AxiosErrorParse(err: AxiosError) { | |
| // Error | |
| if (err.response) { | |
| // The request was made and the server responded with a status code | |
| // that falls out of the range of 2xx | |
| return {success: false, error: err.response.data.message}; | |
| } else if (err.request) { | |
| // The request was made but no response was received |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.fn.isInViewport = function() { | |
| var win = $(window); | |
| var viewport = { | |
| top: win.scrollTop(), | |
| left: win.scrollLeft(), | |
| }; | |
| viewport.right = viewport.left + win.width(); | |
| viewport.bottom = viewport.top + win.height(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ENSURE HTTPS EVERYWHERE | |
| RewriteCond %{HTTP:X-Forwarded-Proto} !https | |
| RewriteCond %{HTTPS} off | |
| RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function fileExists(url, callback) { | |
| var http = new XMLHttpRequest(); | |
| http.open('HEAD', url); | |
| http.onreadystatechange = function() { | |
| if (this.readyState === this.DONE) { | |
| if (this.status !== 404) { | |
| callback(); | |
| } | |
| } | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @mixin realhover() { | |
| html.can-hover &:hover { | |
| @content; | |
| } | |
| } | |
| ul li { | |
| @include realhover { | |
| ul { | |
| display:block; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var animateOut = function() { | |
| var animateElements = $('.animated'); | |
| var clickLinks = $( 'a[href*="' + window.location.hostname + '"], a[href^="/"]'); | |
| var body = $('body'); | |
| var classList = [ | |
| 'bounce','flash','pulse','rubberBand', | |
| 'shake','headShake','swing','tada', | |
| 'wobble','jello','bounceIn','bounceInDown', | |
| 'bounceInLeft','bounceInRight','bounceInUp','bounceOut', | |
| 'bounceOutDown','bounceOutLeft','bounceOutRight','bounceOutUp', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="block__wrapper__list"> | |
| <?php | |
| $count = 1; | |
| $chunk = 5; | |
| while ( $query->have_posts() ) { | |
| if ($count % $chunk == 1) { | |
| ?> | |
| <div class="block__wrapper__list__chunk"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="accordion"> | |
| <div class="accordion__header">Title</div> | |
| <div class="accordion__content">Body Copy</div> | |
| </div><!-- accordion wrapper --> |