Skip to content

Instantly share code, notes, and snippets.

View nicoonoclaste's full-sized avatar

nicoo nicoonoclaste

View GitHub Profile
@nicoonoclaste
nicoonoclaste / flake.nix
Created July 16, 2026 17:06
flake: Generate outputs for all systems without dependencies
{
description = "Generate flake outputs for all systems without dependencies";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs = { self, nixpkgs, ... }@inputs: let
inherit (nixpkgs) lib;
gen = lib.flip lib.pipe [
@nicoonoclaste
nicoonoclaste / testcase.sh
Last active January 3, 2021 16:12
ipython#12753 crash testcase
#!/bin/sh -eu
COMMAND_STYLE="$(tput bold)$(tput setaf 4)"
NOTICE_STYLE="$(tput bold)$(tput setaf 3)"
NORMAL_STYLE="$(tput sgr0)"
run() {
echo "${COMMAND_STYLE}\$ $@${NORMAL_STYLE}"
"$@"
echo
}
@nicoonoclaste
nicoonoclaste / bench.sh
Last active August 4, 2020 15:13
Benchmarking uutils/coreutils' factor too
#!/bin/bash
set -euo pipefail
echo "Commit id,Commit message,Mean (s),σ (s),Median (s),User (s),System (s),Min (s),Max (s)" > table.csv
for rev in $(git rev-list --reverse master..); do
git checkout "$rev"
cargo build --release
hyperfine --export-csv table.tmp.csv "seq 2 $((10 ** 7)) | ../../../target/release/factor > /dev/null"
{ echo -n "$(git show -q --format='%h,%s,')"; tail -n1 table.tmp.csv | cut -d, -f 2-; } >> table.csv
@nicoonoclaste
nicoonoclaste / brownies.md
Created February 3, 2020 15:55
Nicoo's brownies

Ingredients

  • time (10' prep + 25' baking)
  • 300g baking chocolate
  • 150g sugar
  • 150g flour
  • 100g butter
  • 50g oil, hazelnut or walnut (from the original recipe, I keep meaning to try, forgetting, and substituting 50g or so of extra butter instead)
  • vanilla extract (or put some vanilla sugar with the sugar)
  • 2 eggs
@nicoonoclaste
nicoonoclaste / gc.garbage.patch
Created April 30, 2019 17:44
PPB: Reveal which cycles are created (and collected) on each frame
diff --git i/ppb/engine.py w/ppb/engine.py
index 4300133..bc25616 100644
--- i/ppb/engine.py
+++ w/ppb/engine.py
@@ -101,6 +101,7 @@ class GameEngine(Engine, EventMixin, LoggingMixin):
def main_loop(self, collect_statistics: True) -> 'pandas.DataFrame': pass
def main_loop(self, collect_statistics=False):
+ collect_statistics = False
if collect_statistics:
#!/usr/bin/env python3
from math import hypot
from numbers import Real
from ppb_vector import Vector2
from timeit import timeit
class VectorBench(Vector2):
@property
def computed_length(self) -> Real:
$ mypy test.bad.py
test.bad.py:22: error: "V2" has no attribute "method"
$ mypy /tmp/test.good.py
[no errors returned]
@nicoonoclaste
nicoonoclaste / .gitignore
Last active April 27, 2018 08:55
Tweet dump
/keys.py
__pycache__/
*.state
*.xz
@nicoonoclaste
nicoonoclaste / .gitignore
Last active April 23, 2018 11:23
Test for the Ansible apt module
/.vagrant
/log
*.retry
LINTIAN_PROFILE=pkg-perl
info = yes
display-info = yes
pedantic = yes
color = auto