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 ucfirst(word) { | |
const wordarray = word.split(''); | |
wordarray[0] = wordarray[0].toUpperCase(); | |
return wordarray.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
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); |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- # | |
from __future__ import unicode_literals | |
# -------------------------------------- | |
# Now compatible with Pelican 4.0.x! | |
# -------------------------------------- | |
# Added by me | |
import time |
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
'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
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
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
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
:focus::-webkit-input-placeholder{ | |
color: transparent; | |
} | |
:focus::-moz-placeholder { | |
color: transparent; | |
} | |
:focus:-ms-input-placeholder { | |
color: transparent; |