Simple script to export highlights from a Kindle.
Requirments
- macOS host
- Kindle plugged into Mac
- Deno installed on Mac
/// facebook-hide-sponsored.js | |
(() => { | |
"use strict"; | |
const INTERVAL = 1500; | |
setInterval(() => { | |
let element = Array.from( | |
document.querySelectorAll( | |
`span[style="-webkit-box-orient:vertical;-webkit-line-clamp:2;display:-webkit-box"]` | |
) | |
).find(({ innerHTML }) => innerHTML.trim() === "Sponsored"); |
Simple script to export highlights from a Kindle.
Requirments
#!/usr/bin/env bash | |
head $1 -n 1 | jq -r keys_unsorted | jq -cr 'join(",")' > $1.csv | |
jq -r 'join(",")' $1 >> $1.csv |
import { parseHTML } from "https://esm.sh/linkedom@0.14.25"; | |
import * as ObservablePlot from "https://esm.sh/@observablehq/plot@0.6.7"; | |
// @ts-ignore: bad type | |
const { document } = parseHTML(`<!DOCTYPE html><html lang="en"></html>`); | |
export const Plot: typeof ObservablePlot = { | |
...ObservablePlot, | |
plot: (options?: ObservablePlot.PlotOptions) => { | |
const elt = ObservablePlot.plot({ document, ...options }); |
using LinearAlgebra | |
# A utility for computing the unique invariant probability | |
# vector for a finite, time homogeneous, irreducible, and aperiodic Markov chain | |
# from its transition probability matrix. | |
function invariantProb(P) | |
PT = transpose(P) | |
left_eigenvectors = nullspace(PT - I) | |
normalized_left_eigenvector = left_eigenvectors[:, 1] / sum(left_eigenvectors[:, 1]) | |
return normalized_left_eigenvector |
Inject this css snippet to remove all ads from your Twitter timeline.
div[data-testid="placementTracking"]:has(path[d="M19.498 3h-15c-1.381 0-2.5 1.12-2.5 2.5v13c0 1.38 1.119 2.5 2.5 2.5h15c1.381 0 2.5-1.12 2.5-2.5v-13c0-1.38-1.119-2.5-2.5-2.5zm-3.502 12h-2v-3.59l-5.293 5.3-1.414-1.42L12.581 10H8.996V8h7v7z"]) {
display: none;
}