This file contains 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 insertScript(url, onload, onerror) { | |
var ref = document.getElementsByTagName('script')[0]; | |
var script = document.createElement('script'); | |
script.src = url; | |
if (typeof onload === 'function') { | |
script.onload = onload; | |
} | |
if (typeof onerror === 'function') { | |
script.onerror = onerror; | |
} |
This file contains 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 $_( selectors, baseElement ) { | |
var elements = (baseElement || document).querySelectorAll( selectors ); | |
return Array.prototype.slice.call( elements ); | |
} |
This file contains 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 isInteractiveElement( element ) { | |
if ( [ 'A', 'BUTTON', 'DETAILS', 'EMBED', 'IFRAME', 'KEYGEN', 'LABEL', 'SELECT', 'TEXTAREA' ].indexOf( element.nodeName ) !== -1 ) { | |
return true; | |
} | |
if ( element.nodeName === 'INPUT' && element.type !== 'hidden' ) { | |
return true; | |
} | |
if ( ['AUDIO', 'VIDEO'].indexOf( element.nodeName ) > -1 && element.hasAttribute('controls') ) { | |
return true; | |
} |
This file contains 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
--- | |
linters: | |
BangFormat: | |
space_before_bang: true | |
space_after_bang: false | |
BemDepth: | |
enabled: false | |
BorderZero: | |
enabled: true | |
convention: none |
This file contains 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 camelCase = str => str.split( /[_,-]+/ ).map( ( item, index ) => index === 0 ? item : item.charAt(0).toUpperCase() + item.slice(1).toLowerCase() | |
).join(''); |
This file contains 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() { | |
const links = Array.from( document.querySelectorAll( 'link[title]' ) ); | |
const styles = Array.from( new Set( links.map( link => link.title ) ) ); | |
let title = localStorage.getItem( 'title' ); | |
function selectStyle( title ) { | |
links.forEach( link => { | |
link.disabled = true; | |
link.disabled = link.title !== title; | |
}); |
This file contains 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() { | |
window.addEventListener( 'load', function() { | |
var links = Array.prototype.slice.call( document.querySelectorAll( 'link[title]') ); | |
var uniqueTitles = links.reduce( function( titles, link ) { | |
if ( titles.indexOf( link.title ) === -1 ) { | |
titles.push( link.title ); | |
} | |
return titles; | |
}, []); | |
var title = window.sessionStorage && window.sessionStorage.getItem( 'title' ) || ''; |
This file contains 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
--- | |
layout: none | |
--- | |
<?xml version="1.0" encoding="UTF-8"?> | |
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> | |
{% for post in site.posts %}{% unless post.unpublished == false %}<url> | |
<loc>{{ site.url }}{{ post.url }}</loc> | |
<lastmod>{% if post.sitemap.lastmod %}{{ post.sitemap.lastmod | date: "%Y-%m-%d" }}{% else %}{{ post.date | date_to_xmlschema }}{% endif %}</lastmod>{% if post.sitemap.changefreq %} | |
<changefreq>{{ post.sitemap.changefreq }}</changefreq>{% endif %}{% if post.sitemap.priority %} | |
<priority>{{ post.sitemap.priority }}</priority>{% endif %} |
This file contains 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(doc, body) { | |
const main = doc.querySelector('main').parentNode.removeChild(doc.querySelector('main')); | |
while (body.firstChild) body.removeChild(body.firstChild); | |
body.appendChild(main) | |
}(document, document.body)); |
This file contains 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
// Place your settings in this file to overwrite the default settings | |
{ | |
"editor.fontFamily": "Source Code Pro", | |
"editor.fontSize": 14, | |
"editor.renderWhitespace": "all", | |
"editor.renderIndentGuides": false, | |
"editor.selectionHighlight": false, | |
"files.insertFinalNewline": true, | |
"workbench.colorTheme": "Solarized Dark", | |
"workbench.iconTheme": "vs-minimal", |