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 *pollForWeatherInfo(){ | |
| while (true) { | |
| yield fetch('/api/currentWeather', { | |
| method: 'get' | |
| }).then(res => res.json()) | |
| } | |
| } | |
| function runPolling(generator){ | |
| if (!generator) { |
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
| <template> | |
| <div class="dropdown-wrapper" :class="{ open }"> | |
| <a class="dropdown-title" @click="toggle"> | |
| <span class="title">{{ item.text }}</span> | |
| <span class="arrow" :class="open ? 'down' : 'right'"></span> | |
| </a> | |
| <DropdownTransition> | |
| <ul class="nav-dropdown" v-show="open"> | |
| <li | |
| class="dropdown-item" |
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 nprogress from 'nprogress' | |
| export default { | |
| // ... | |
| // configure progress bar | |
| nprogress.configure({ showSpinner: false }) | |
| this.$router.beforeEach((to, from, next) => { | |
| if (to.path !== from.path && !Vue.component(pathToComponentName(to.path))) { |
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
| // ---- | |
| // Sass (v3.4.21) | |
| // Compass (v1.0.3) | |
| // ---- | |
| // _colors.scss | |
| $white: #FFFFFF; | |
| $black: #000000; | |
| $navy: #003C5A; |
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
| <style> | |
| .file-desc::before { | |
| content: "\2193 \00a0"; | |
| color: rgba(239,187,53,.6); | |
| } | |
| </style> | |
| <p class="file-desc">someFile.js</p> |
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
| new ContextReplacementPlugin(/moment[\/\\]locale$/, /uk/), | |
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
| /* TODO: Add support for page, chapter and figure counters */ | |
| /* Built with the help of https://www.smashingmagazine.com/2015/01/designing-for-print-with-css/ */ | |
| @media print { | |
| main { | |
| width: 100%; | |
| margin: 0; | |
| } | |
| @page { margin: 2cm } |
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
| $(document).ready(function () { | |
| $.jAlert({ | |
| 'type': 'confirm', | |
| 'confirmQuestion': 'Do you want to add this?', | |
| 'onConfirm': function(e, btn){ | |
| e.preventDefault(); | |
| //do something here | |
| btn.parents('.jAlert').closeAlert(); | |
| return false; |
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
| const supportsTouch = 'ontouchstart' in window || navigator.msMaxTouchPoints; | |
| const agentSniff = typeof window.orientation !== "undefined" || | |
| /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); | |
| export default supportsTouch && agentSniff; |
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
| // Determine if an element matches a selector | |
| export const matches = (el, selector) => { | |
| if (!isElement(el)) { | |
| return false | |
| } | |
| // https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill | |
| // Prefer native implementations over polyfill function | |
| const proto = Element.prototype | |
| const Matches = proto.matches || |