Skip to content

Instantly share code, notes, and snippets.

@laqie
laqie / bench.txt
Last active December 7, 2024 13:57
AoC 2024 Day 7
CPU | Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
Runtime | Deno 2.1.3 (x86_64-pc-windows-msvc)
benchmark time/iter (avg) iter/s (min … max) p75 p99 p995
----------------------- ----------------------------- --------------------- --------------------------
group part one
part one 382.0 µs 2,618 (358.9 µs … 964.1 µs) 376.7 µs 536.0 µs 574.4 µs
part one with parsing 1.4 ms 737.2 ( 1.3 ms … 1.9 ms) 1.4 ms 1.7 ms 1.9 ms
#!/bin/bash
#
# This file echoes a bunch of color codes to the
# terminal to demonstrate what's available. Each
# line is the color code of one forground color,
# out of 17 (default + 16 escapes), followed by a
# test use of that color on all nine background
# colors (default + 8 escapes).
#
@laqie
laqie / concurrency-in-go.md
Created January 7, 2016 11:23 — forked from kachayev/concurrency-in-go.md
Channels Are Not Enough or Why Pipelining Is Not That Easy
@laqie
laqie / gist:6711485
Created September 26, 2013 08:40
Euler 22
reduce(lambda result, (index, name): result + index * reduce(lambda s, l: s + ord(l) - ord('A') + 1, name, 0), enumerate(sorted(open('names.txt').read().replace('"', '').split(',')), 1), 0)