Skip to content

Instantly share code, notes, and snippets.

@dmbaturin
dmbaturin / gist:c82de5490d86aff9dea23cd6b396e93d
Created December 23, 2019 15:04
VyOS contributor statistics 2019
Commits Name Email
1464 Daniil Baturin daniil@...
1398 Christian Poessinger christian@...
468 Alex Harpin development@...
367 Kim Hagen kim.sidney@...
343 hagbard vyosdev@...
76 Runar Borge runar@...
68 John Estabrook jestabro@...
61 Kim Hagen khagen@...
56 Kim UnicronNL@...
@dmbaturin
dmbaturin / gist:948a8eb8ddf93dc3f430d9e3b2fdb2b7
Created July 24, 2019 05:52
Falsehoods programmers believe about falsehoods
1. Zero is always equivalent to false.
2. Zero always has a truth value.
3. Everyone thinks it's enough to show that (not P) is true to prove that P is false.
4. There's no practical use in thinking otherwise.
5. You can reason about truth if you have contradictory axioms.
6. You cannot reason about truth if you have contradictory axioms.
7. This statement is false.
8. Statement [7] is true.
9. Ok, but at least one of them is false.
10. You are kidding me, right?
#!/usr/bin/env python
import sys
import re
has_txt_type = 0
has_non_txt_type = 0
has_syntax_commit_expr_txt = 0
has_syntax_commit_expr_non_txt = 0
# Copyright (c) 2016 VyOS maintainers and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the Software
# is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
@dmbaturin
dmbaturin / list-test.go
Last active December 17, 2020 20:18
A dumb microbenchmark: folding a 10000000 element list in OCaml vs C++ vs Python vs Go
Aggregate results:
Wall time:
OCaml: 0.76s
C++ (gcc defaults): 1.45s
C++ (gcc with -O2): 0.62s
Python: 2.18s
Go: 3.3s
Memory consumption:
@dmbaturin
dmbaturin / gist:5380143
Created April 13, 2013 21:26
attach tohou titles to developer roles
#!/usr/bin/env python
import random
class ThCredits:
""" Attaches fancy titles to developer roles """
_epithets = [
"nine-tailed %s",
"ordinary %s",
#!/usr/bin/env perl
@glider= ([ 0, 1, 0 ],
[ 0, 0, 1 ],
[ 1, 1, 1 ]);
@hacker= ([ 3.00, 3.00, 2.45 ],
[ 4.00, 2.90, 2.85 ],
[ 4.00, 2.90, 2.88 ],
[ 3.90, 3.80, 2.95 ],
#include <stdio.h>
void swap(int* a, int* b)
{
int tmp = *a;
*a = *b;
*b = tmp;
}
int main(void)