Skip to content

Instantly share code, notes, and snippets.

View gnprice's full-sized avatar

Greg Price gnprice

View GitHub Profile
#!/bin/bash
set -eu
usage() {
cat >&2 <<'EOF'
usage: ./difflog $out1 $out2
Compare two Nix build logs, normalizing out boring differences.
This can be useful to test the effect of a change to build scripts,
@gnprice
gnprice / 00-def.js
Last active June 21, 2021 22:06
Generated notifs code
/* eslint-disable */
!(function(r) {
(r.__r = o),
(r.__d = function(r, i, n) {
if (e[i] != null) {
return;
}
const o = {
dependencyMap: n,
factory: r,
@gnprice
gnprice / main.dart
Last active February 4, 2023 06:39
Exhaustiveness failure on Dart map patterns
import 'dart:collection';
void main() {
print(test({})); // -> unknown
print(test(BadMap2(false, 5))); // -> double
print(test(BadMap())); // -> oops! this map must be a sneaky one
}
String test(Map<bool, int> map) => switch (map) {
{} => 'unknown',