View video-toggle.js
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
// ==UserScript== | |
// @name Toggle double playback rate | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Sets video playback rate to (3 - current rate) | |
// @author You | |
// @match *://*/* | |
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
// @grant none | |
// @run-at context-menu |
View to_csv.jq
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
def to_csv: | |
( [.[] | keys | .[]] | unique ) as $keys | |
| ( $keys | @csv ) | |
, ( .[] | |
| . as $row | |
| reduce ($keys | .[]) as $key ([]; [.[], ($row | .["\($key)"])]) | |
| @csv | |
); | |
def uniform_array_to_csv: |
View job-pool.js
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
const applyAsync = (f, pool) => (x, i) => | |
Promise.resolve(x) | |
.then((v) => new Promise((r) => pool.push({ i, v, r }))) | |
.then(f); | |
const worker = (getTimeout) => (it, i) => { | |
const { done, value } = it.next(); | |
if (done) return; | |
const { v, r } = value; | |
setTimeout( |
View script.js
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
// ==UserScript== | |
// @name Convert CMS2021 Schedule to Local Time | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Convert CMS2021 schedule to local time | |
// @author David Baynard | |
// @match https://cms21.io/agenda/ | |
// @icon https://www.google.com/s2/favicons?domain=cms21.io | |
// @grant none | |
// ==/UserScript== |
View gist:523700a1a5bed1628fd817c833460c6e
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
Install arch https://wiki.archlinux.org/title/Chrome_OS_devices/Crostini | |
lxc config set arch security.nesting true | |
Within arch, configure downloads | |
mkdir ~/Downloads && sudo mount -o bind /mnt/chromeos/MyFiles/Downloads ~/Downloads | |
Install nix (just use the standard multi-user nix installer) | |
Install lxd | |
Add user to group lxd | |
sudo systemctl enable lxd.service | |
logout cycle for arch | |
lxd init |
View basket.js
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
// Paste into dev console | |
[...document.querySelectorAll(".a-list-item, .huc-v2-item-msg")].map(x => { | |
const lims = x.innerText.match(/from £([0-9.]+) to £([0-9.]+)/)?.slice(1,3); | |
if (!!lims) { | |
const p = lims[1] - lims[0]; | |
const y = 100*p/lims[0]; | |
return [p, `£${p.toFixed(2)} (${y.toFixed(1)} %): ${x.innerText}`]; | |
} | |
}).filter(x => !!x).sort((a,b) => b[0] - a[0]).forEach(([_,v]) => console.log(v)); |
View git-review.sh
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 zsh | |
# | |
# Review github PRs. | |
# | |
# This script makes reviewing github PRs simple. Supply the requester's branch | |
# in the form it is presented at the top of the PR on github (i.e. user:branch). | |
# This adds: | |
# | |
# - a new remote corresponding to the user, with only the PR branch | |
# - a new local branch (unless a branch with that name exists already, in |
View jindosh.lhs
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
--- | |
title: Jindosh puzzle | |
author: David Baynard | |
date: 16 Jan 2019 | |
fontfamily: libertine | |
csl: chemical-engineering-science.csl | |
link-citations: true | |
abstract: | | |
... |
View diagonal-span.hs
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
-- | | |
-- Module : diagonal-span | |
-- Copyright : David Baynard 2018 | |
-- License : BSD-3-Clause OR Apache-2.0 | |
-- | |
-- Maintainer : haskell@baynard.me | |
-- Stability : experimental | |
-- Portability : unknown | |
-- | |
-- A proposal for a correct by construction abstract syntax tree for pandoc |
View Forestay.lhs
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
--- | |
title: Forestay | |
author: David Baynard | |
date: 05 Jun 2017 | |
fontfamily: libertine | |
csl: chemical-engineering-science.csl | |
link-citations: true | |
abstract: | | |
... |
NewerOlder