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 python3 | |
# Reads OS X / Safari reading list and dumps out URLs. | |
import plistlib | |
import os | |
for p in [ | |
y["URLString"] | |
for y in [ | |
x | |
for x in plistlib.load( |
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
{ | |
"config": { | |
"view": { | |
"continuousWidth": 300, | |
"continuousHeight": 300 | |
} | |
}, | |
"layer": [ | |
{ | |
"mark": { |
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
{ | |
"$schema": "https://vega.github.io/schema/vega-lite/v5.json", | |
"description": "Timeline", | |
"title": "Hey there", | |
"width": 600, | |
"height": 200, | |
"data": { | |
"values": [ | |
{"idx": 0, "start": 0, "name": "Took a minute", "end": 60000}, | |
{"idx": 1, "start": 60000, "name": "Took half a minute", "end": 90000}, |
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
// https://adventofcode.com/2021/day/5 in SQL with some algebra. | |
// I only checked this with the example, not the full data set :) | |
// | |
// Run this with `sqlite < aoc2021-day-5-sqlite.sql`. | |
WITH | |
RECURSIVE ints(v) AS ( | |
SELECT 0 UNION ALL | |
SELECT v + 1 FROM ints | |
WHERE v + 1<= 10 |
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 | |
set -x -euo pipefail | |
git show HEAD^:$1 > $1 | |
git add $1 | |
git commit --fixup HEAD | |
git revert --no-edit HEAD | |
git commit --amend -m"$1" | |
EDITOR=/usr/bin/true git rebase -i --autosquash HEAD^^^ |
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 | |
# | |
# Given a log file of JSON objects with timestamps, adds a new field called | |
# "relativeTimeMs" for the duration between successive log lines, and then | |
# sorts by that field to pull out the "longest" log lines. | |
echo '{"time":"2019-08-08T17:08:08.343Z","msg":"foo"} | |
{"time":"2019-08-08T17:08:08.347Z","msg":"bar"} | |
{"time":"2019-08-08T17:08:08.349Z","msg":"baz"} | |
{"time":"2019-08-08T17:08:09.322Z","msg":"booooom"} |
This file has been truncated, but you can view the full file.
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
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> | |
<script type="text/javascript"> | |
google.charts.load("current", {packages:["timeline", "corechart"]}); | |
google.charts.setOnLoadCallback(drawChart); | |
function ts_to_hms(secs) { | |
var s = secs % 60; |
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
. |
Hey | There |
---|---|
NewLine | Bar |
NewerOlder