Something like utteranc.es
But some ideas to roll a bit of your own...
https://pknopf.com/post/2018-10-13-comments-for-static-sites-using-github-issues/
const fs = require("fs"); | |
const sharp = require("sharp"); | |
const arguments = process.argv.slice(2); | |
const directory = arguments[0]; | |
// This function is probably the useful part | |
async function convertToFormats(input, output) { | |
await sharp(input) | |
.avif({ quality: 80, speed: 3 }) |
Something like utteranc.es
But some ideas to roll a bit of your own...
https://pknopf.com/post/2018-10-13-comments-for-static-sites-using-github-issues/
There’s a lot to love about functional programming. While this isn’t the place to layout the benefits or tradeoffs of the functional programming style, its safe to say that the concepts can bring a lot of order, power, and simplicity to your code. However, in all of that, it’s also easy to get lost in the weeds of terminology and mathematical jargon. My goal in this post is to take a shallow dive into the world of functional programming, currying, and point-free functions in JavaScript and explain one use case where functional programming improves the readability of a simple function.
I was working on a JavaScript function this week that takes a timestamp and converts it to a date object in order to compare different dates. The original function looked like this:
/**
/** | |
* Create a string to use for the search element in window.location | |
* | |
* @params {string} search - the original window.location.search value | |
* @params {Object} params - the new params to add to the search | |
*/ | |
export const createNewSearchParams = ({ | |
search = window.location.search, | |
params = {}, | |
}) => { |
// Define a default animation duration | |
const defaultAnimationDuration = 6000; | |
/** | |
* Smoothly scroll the browser's window up or down a certain number of pixels | |
* | |
* @param {Number} pixels - the number of pixels to scroll the screen (positive or negative) | |
* @param {Number} [time=300] - the amount of time in milliseconds to annimate the scroll | |
*/ | |
export const smoothScroll = (pixels, time = defaultAnimationDuration) => { |
/* Performance matters */ | |
.system-font { | |
font-family: BlinkMacSystemFont,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif; | |
} |