Skip to content

Instantly share code, notes, and snippets.

View freshyill's full-sized avatar
💭
😎 Cool

Chris Coleman freshyill

💭
😎 Cool
View GitHub Profile
@freshyill
freshyill / zip_folders.sh
Created June 26, 2017 18:01
Zip each folder in directory
for f in * [14:00:21]
do
zip -r "${f}.zip" "$f"
done
@freshyill
freshyill / smoothScroll.js
Created January 16, 2018 05:47
Simple smooth scrolling for internal links
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 / .eleventy.js
Last active April 13, 2022 14:38
YouTube Editor component for Netlify CMS
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 / .eleventy.js
Last active April 23, 2021 17:13
Vimeo Editor Component for Netlify CMS
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 / .eleventyconfig.js
Last active January 23, 2023 10:49
JSON feed template for eleventy-plugin-rss
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 / node-sass.js
Created August 3, 2019 04:23
Setting up node-sass directly is needlessly complicated and the documentation sucks.
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 / currentnav.js
Last active February 27, 2020 18:19
Extremely simple active nav highlighting with JS
let links = document.querySelectorAll(".nav a");
for (var i = 0; i < links.length; i++) {
if (links[i].pathname == window.location.pathname) {
links[i].classList.add("current");
}
}
@freshyill
freshyill / getZotero.js
Created March 27, 2020 23:59
Get library from Zotero
async function getZotero(req) {
let nextBtn = document.getElementById("loadNext");
let prevBtn = document.getElementById("loadPrev");
let content = document.getElementById("content");
let links = {};
await axios.get(req).then(function(response) {
content.innerHTML = '';
@freshyill
freshyill / illtron_main.png
Last active June 2, 2020 01:26
Illtron 2005
illtron_main.png
@freshyill
freshyill / input.scss
Created March 21, 2021 06:01
Generated by SassMeister.com.
$count: 8;
@for $i from 1 through $count {
@keyframes logo#{$i} {
@if $i != 1 {
from {
opacity: 0;
}
}