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 hasAtSupports(){ | |
return (window.CSSRule !== undefined) && (window.CSSRule.SUPPORTS_RULE !== undefined) | |
} |
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
/* | |
Page Visibility wrapper | |
Tiffany B. Brown <http://tiffanybbrown.com/> | |
Released under an MIT license. | |
This script adds a wrapper around prefixed versions of | |
document.visibilityState and document.hidden so that you can use a | |
single syntax and listen for a single event. | |
Permission is hereby granted, free of charge, to any person obtaining |
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 change_extension($filename, $index, $extension) { | |
if (pathinfo($filename, PATHINFO_EXTENSION) == 'md'): | |
$fn = sprintf("%s.%s", pathinfo($filename, PATHINFO_FILENAME), (string)$extension); | |
$success = rename(sprintf('./%s', $filename), $fn); | |
endif; | |
if($success) { | |
printf("Success! %s was renamed to %s\n", $filename, $fn); | |
} | |
} |
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
// See current support chart http://caniuse.com/#search=flexbox | |
/* | |
Flexbox mixins | |
Public Domain. | |
Latest syntax only. | |
*/ | |
@mixin display-flex { | |
display: -webkit-flex; |
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
export function expandRGB(string) { | |
if(!(/#[a-f0-9]{3}$/i).test(string)) return string; | |
const rgb = string.split(''); | |
return `#${rgb[1]}${rgb[1]}${rgb[2]}${rgb[2]}${rgb[3]}${rgb[3]}`; | |
} |
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 percentToFloat = (percentString) => { | |
return parseInt(percentString, 10) / 100; | |
} | |
/* | |
* Copied, pasted, and modified straight from the CSS4 spec | |
* https://drafts.csswg.org/css-color-4/#hsl-to-rgb | |
*/ | |
const hueToRgb = (t1, t2, hue) => { | |
let hueValue; |
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
'use strict'; | |
exports.handler = (event, context, callback) => { | |
const request = event.Records[0].cf.request; | |
const response = event.Records[0].cf.response; | |
// frame-src is deprecated, but Chrome AFAIK doesn't yet support child-src. Using both here. | |
response.headers['content-security-policy'] = [{ | |
key: 'Content-Security-Policy', | |
value: "default-src 'self'; script-src 'self' https://webinista.us3.list-manage.com; font-src https://*; frame-src 'self' *.tiffanybbrown.com *.webinista.com; child-src 'self' *.tiffanybbrown.com *.webinista.com; img-src https://*; block-all-mixed-content" |
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
If you've recently added a self-signed SSL certificate to your keychain, try deleting it. |
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 range = (min, max) => { | |
const diff = max - min; | |
const spread = [...Array(diff).keys()].map(n => {return n + min}); | |
spread.push(max); | |
return spread; | |
} | |
// Example usage | |
range(2,100); |