This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import logging | |
import subprocess | |
import re | |
import sys | |
import datetime | |
RE_SPACES = re.compile('\s+') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fs from 'fs'; | |
// as per https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/master/CSSModules/v1Explainer.md | |
export default function cssModules() { | |
return { | |
name: 'css-modules', | |
async load(id) { | |
if (!id.endsWith('.css')) { | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
command_exists() { | |
type "$1" &> /dev/null | |
} | |
for X in "$@"; do | |
if [ ${X: -4} == '.png' ]; then | |
if command_exists zopflipng; then | |
zopflipng "$X" "$X" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Useful bash functions. This is sourced by the environment file. | |
# These are available to scripts, but you shouldn't use them in scripts if you | |
# want them to be portable. | |
# Usage: pathremove /path/to/bin [PATH] | |
# Eg, to remove ~/bin from $PATH | |
# pathremove ~/bin PATH | |
function pathremove { | |
local IFS=':' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
heading() { | |
# or "\e" on *nix | |
HEAD="\033[96m\033[1m" | |
DONE="\033[0m" | |
echo -e "${HEAD}${1}${DONE}" | |
} | |
# 0) find local git repo, or fail now |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function lebReader(array) { | |
const view = new Uint8Array(array); | |
let at = 0; | |
return () => { | |
if (at >= view.length) { | |
return -1; | |
} | |
let ret = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Raw IDObserver class. Use via default method below. | |
*/ | |
export class IDObserver { | |
/** | |
* @param {!Node|!ShadowRoot} root | |
*/ | |
constructor(root) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// nb. This code is available in an ES module of Promise helpers, here: | |
// https://github.com/samthor/promises | |
// symbol returned to indicate that a call was cancelled | |
export const takeoverSymbol = Symbol('takeover'); | |
/** | |
* Accepts a generator function, which yields Promises, and converts it to an async function | |
* that cancels any previous calls. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <string.h> | |
#include <stdlib.h> | |
typedef struct { | |
int chunks, w, h; | |
} info_t; | |
const char expected_header[8] = {0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FIXME: glitch doesn't know about Map/Set for some reason | |
var Map = window['Map']; | |
var Set = window['Set']; | |
/** | |
* @typedef {{i: number, o: *}} | |
*/ | |
var IntervalData; |