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 || |
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 fetchStream(url) { | |
const req = new Request(url) | |
return fetch(req).then(rs => { | |
const reader = rs.body.getReader() | |
return reader.read().then(({ done, value }) => { | |
const decoder = new TextDecoder('utf-8') | |
return decoder.decode(value) | |
}).catch(err => console.log(`Could not fetch from ${url}!`, err)) |
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 date = new Date() | |
const day = date.getDate() | |
const month = date.getMonth() + 1 | |
const year = date.getFullYear() | |
const time = `${month}/${day}/${year}` |
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
String.prototype.trunc = String.prototype.trunc || function(n) { | |
return (this.length > n) ? this.substr(0, n-1) + '…' : this; | |
}; |