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
import {MDXProvider} from '@mdx-js/react'; | |
import {MDXComponents} from 'components/MDX/MDXComponents'; | |
import {Toc} from 'components/Toc/Toc'; | |
import * as React from 'react'; | |
export interface MarkdownProps<Frontmatter> { | |
meta: Frontmatter; | |
children?: React.ReactNode; | |
} |
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
{# | |
// lazyLoaded Image/bgImages, optimized with Imager and Focuspoint | |
--------------------------------------------------------------------------- | |
https://nystudio107.com/blog/creating-optimized-images-in-craft-cms | |
https://github.com/aelvan/Imager-Craft | |
https://github.com/smcyr/Craft-FocusPoint | |
for the bgImage intrinsic ratio classname creation check: | |
https://github.com/inuitcss/inuitcss/blob/develop/objects/_objects.ratio.scss |
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
<head> | |
<script> | |
if (window.localStorage && window.localStorage._tk_cache) { | |
document.documentElement.classList.add('wf-active'); | |
var script = document.createElement('script'); | |
script.innerHTML = localStorage._tk_cache + ";(function () {var timeout = setTimeout(function () {document.documentElement.classList.remove('wf-active');}, 300); Typekit.load({ async: false, active: function () { clearTimeout(timeout); }});})();"; | |
document.head.appendChild(script); | |
} | |
window._tk_onload = function () { | |
var req = new XMLHttpRequest() |
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
import qs from 'qs'; | |
import Axios from 'axios'; | |
Axios.defaults.baseURL = Craft.baseUrl; | |
Axios.defaults.headers.common['Accept'] = 'application/json'; | |
Axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; | |
Axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; | |
Axios.interceptors.request.use(config => { | |
if (config.data === Object(config.data)) { |
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
{# ================================================================== #} | |
{# ================================================================== #} | |
{# Responsive Images | |
{# ================================================================== #} | |
{# ================================================================== #} | |
{# | |
{% import '_macros/img' as macroImg %} | |
Macro to centralize the markup and config for responsive images. | |
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
// array utils | |
// ================================================================================================= | |
const combine = (...arrays) => [].concat(...arrays); | |
const compact = arr => arr.filter(Boolean); | |
const contains = (() => Array.prototype.includes | |
? (arr, value) => arr.includes(value) | |
: (arr, value) => arr.some(el => el === value) |
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
# remove | |
/usr/libexec/PlistBuddy -c 'Add :LSUIElement bool true' /Applications/iTerm.app/Contents/Info.plist | |
# restore | |
/usr/libexec/PlistBuddy -c 'Delete :LSUIElement' /Applications/iTerm.app/Contents/Info.plist |