Skip to content

Instantly share code, notes, and snippets.

View zachleat's full-sized avatar
🚨
GitHub Drop ICE

Zach Leatherman zachleat

🚨
GitHub Drop ICE
View GitHub Profile
@pdehaan
pdehaan / 11ty-website-sites-to-github.mjs
Created March 21, 2022 00:17
Best guess at injecting GitHub usernames into src/_data/sites/*.json files.
import cp from "node:child_process";
import fse from "fs-extra";
import fetch from "node-fetch";
import glob from "fast-glob";
const files = await glob("*.json");
for (const file of files) {
// Pipe through `tail -1` to get original commit, set encoding to "utf-8" instead of default "buffer".
// Modified from Jeremy Keith’s lovely bookmarklet: https://adactio.com/journal/16523
javascript:(function(){open('https://googlechrome.github.io/lighthouse/viewer/?psiurl='+escape(document.location)+'&strategy=mobile&category=performance&category=accessibility&category=best-practices&category=seo&category=pwa', 'test__lighthouse')})();
@getify
getify / 1.js
Last active March 19, 2023 08:32
tag function for formatting console.log(..) statements
function logger(strings,...values) {
var str = "";
for (let i = 0; i < strings.length; i++) {
if (i > 0) {
if (values[i-1] && typeof values[i-1] == "object") {
if (values[i-1] instanceof Error) {
if (values[i-1].stack) {
str += values[i-1].stack;
continue;
}
// paste in your console
speechSynthesis.onvoiceschanged = function() {
var msg = new SpeechSynthesisUtterance();
msg.voice = this.getVoices().filter(v => v.name == 'Cellos')[0];
msg.text = Object.keys(window).join(' ');
this.speak(msg);
};
"use strict";
var _ = SM.import('lodash');
var DOM = SM.import('sm-dom');
var Uri = SM.import('sm-uri');
// WebKit (as of version 538.35.8) fires a useless popstate event after every
// page load, even when the page wasn't popped off the HTML5 history stack. We
// only want to handle popstate events that result from a page actually being
// popped off the HTML5 history stack, so we need a way to differentiate between
@magicznyleszek
magicznyleszek / jekyll-and-liquid.md
Last active January 12, 2024 03:46
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes:

@jhannah
jhannah / gist:6393686
Created August 30, 2013 19:55
git rebase after changing files which the base branch has MOVED
https://twitter.com/deafferret/status/373530616655917057
Mind. Blown.
Did you know when rebasing in git it even correctly patches files that were MOVED in the base branch? I...
Wow.
<3 git
Here, let me show you:
@mathiasbynens
mathiasbynens / opera-15-regressions.md
Last active September 23, 2023 14:50
List of things that broke with the Opera 15 release due to the switch to Blink/Chromium (Web features, not UI-specific stuff)
@grorg
grorg / Emoji.plist
Last active March 22, 2021 18:38
Use text substitution to make typing emoji easy on OS X.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
Text expansion shortcuts for a bunch of emoji.
e.g. ";poo" -> 💩
Not all emoji are included, but I tried to come up with obvious names. There
are also a few in-jokes, sorry.
Cheat sheet: https://gist.github.com/grorg/4773372