Skip to content

Instantly share code, notes, and snippets.

💭
😎 Cool

Chris Coleman freshyill

💭
😎 Cool
Block or report user

Report or block freshyill

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@freshyill
freshyill / node-sass.js
Created Aug 3, 2019
Setting up node-sass directly is needlessly complicated and the documentation sucks.
View node-sass.js
const sass = require('node-sass');
const fs = require('fs');
const scssFile = 'src/site/_includes/scss/style.scss';
const cssFile = 'src/css/style.css';
sass.render({
file: scssFile,
sourceMap: true,
outputStyle: 'compressed',
@freshyill
freshyill / .eleventyconfig.js
Last active Apr 3, 2019
JSON feed template for eleventy-plugin-rss
View .eleventyconfig.js
const pluginRss = require("@11ty/eleventy-plugin-rss");
module.exports = function(eleventyConfig) {
// Lots of other stuff probably goes here
eleventyConfig.addCollection("allUpdates", function(collection) {
return collection.getFilteredByGlob(["posts/*.md", "photos/*.md", "notes/*.md"]).sort(function(a, b) {
return b.date - a.date;
});
@freshyill
freshyill / .eleventy.js
Last active Apr 2, 2019
Vimeo Editor Component for Netlify CMS
View .eleventy.js
module.exports = function(eleventyConfig) { // This only happens once in your template!
// Blah blah, whatever other Eleventy stuff you need.
eleventyConfig.addLiquidShortcode("vimeo", (vimeoId, aspectRatio) => {
return `<div class="aspect-ratio" style="--aspect-ratio: ${aspectRatio}"><iframe src="https://player.vimeo.com/video/${vimeoId}" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen class="video video--vimeo"></iframe></div>`;
});
// Blah blah, whatever other Eleventy stuff you need.
@freshyill
freshyill / .eleventy.js
Last active Apr 2, 2019
YouTube Editor component for Netlify CMS
View .eleventy.js
module.exports = function(eleventyConfig) { // This only happens once in your template!
// Blah blah, whatever other Eleventy stuff you need.
eleventyConfig.addLiquidShortcode("youtube", (youtubeId, aspectRatio) => {
return `<div class="aspect-ratio" style="--aspect-ratio: ${aspectRatio}"><iframe class="youtube-player video video--youtube" src="https://www.youtube.com/embed/${youtubeId}/" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>`;
});
// Blah blah, whatever other Eleventy stuff you need.
@freshyill
freshyill / smoothScroll.js
Created Jan 16, 2018
Simple smooth scrolling for internal links
View smoothScroll.js
function smoothScroll() {
const internalLinks = document.querySelectorAll('a[href^="#"]');
internalLinks.forEach(
function(currentLink) {
const linkHref = currentLink.getAttribute('href');
currentLink.addEventListener("click", function(event) {
document.querySelector(linkHref).scrollIntoView({
@freshyill
freshyill / zip_folders.sh
Created Jun 26, 2017
Zip each folder in directory
View zip_folders.sh
for f in * [14:00:21]
do
zip -r "${f}.zip" "$f"
done
@freshyill
freshyill / count.sh
Last active Apr 25, 2018
Count lines in a directory of files
View count.sh
COUNTER=0;
for files in *;
do
if test -f "$files"; then
LINES=`wc -l $files | awk '{print $1}'`
fi
COUNTER=`expr $COUNTER + $LINES`;
done
@freshyill
freshyill / index.js
Last active Jun 18, 2017
Convert JATS XML to JSON with Camaro
View index.js
const fs = require("fs");
const transform = require("camaro");
const dedent = require("deline");
const xmlDir = "test_xml";
fs.readdir(xmlDir, (err, files) => {
files.forEach(file => {
const xml = fs.readFileSync(xmlDir + "/" + file, "utf-8", (err, data) => {
if (err) throw err;
View keybase.md

Keybase proof

I hereby claim:

  • I am freshyill on github.
  • I am freshyill (https://keybase.io/freshyill) on keybase.
  • I have a public key ASCQl-BDW0UfZrr4mEIklk7u774J8jmiNn0I1gY7WRYd-Ao

To claim this, I am signing this object:

View child.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Child</title>
<style media="screen">
#child {
color: fuchsia;
font-weight: bold;
You can’t perform that action at this time.