Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
😎 Cool

Chris Coleman freshyill

💭
😎 Cool
View GitHub Profile
View .Brewfile
# .Brewfile
# To install: brew bundle install
# Thanks to Casey Liss for pointing me to this!
# https://www.caseyliss.com/2019/10/8/brew-bundle
cask_args appdir: "/Applications"
tap "homebrew/cask-fonts"
tap "homebrew/cask-versions"
tap "homebrew/cask-drivers"
@freshyill
freshyill / input.scss
Created Mar 29, 2021
Generated by SassMeister.com.
View input.scss
$count: 8;
#site-logo {
g[id^="logo"] {
opacity: 0;
animation-duration: 8s;
animation-timing-function: step-end;
animation-direction: reverse; // The `g` elements are layered last-to-first based on their names
animation-iteration-count: infinite;
@freshyill
freshyill / input.scss
Created Mar 21, 2021
Generated by SassMeister.com.
View input.scss
$count: 8;
@for $i from 1 through $count {
@keyframes logo#{$i} {
@if $i != 1 {
from {
opacity: 0;
}
}
@freshyill
freshyill / getZotero.js
Created Mar 27, 2020
Get library from Zotero
View getZotero.js
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 / currentnav.js
Last active Feb 27, 2020
Extremely simple active nav highlighting with JS
View currentnav.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 / 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 2, 2020
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 23, 2021
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 13, 2022
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.