Skip to content

Instantly share code, notes, and snippets.

Daniil Baturin dmbaturin

Block or report user

Report or block dmbaturin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:c82de5490d86aff9dea23cd6b396e93d
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@...
View section-link-highlight.lua
@dmbaturin
dmbaturin / gist:948a8eb8ddf93dc3f430d9e3b2fdb2b7
Created Jul 24, 2019
Falsehoods programmers believe about falsehoods
View gist:948a8eb8ddf93dc3f430d9e3b2fdb2b7
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?
View nodecheck.py
#!/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
View config.py
# 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 Mar 26, 2018
A dumb microbenchmark: folding a 10000000 element list in OCaml vs C++ vs Python vs Go
View list-test.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 Apr 13, 2013
attach tohou titles to developer roles
View gist:5380143
#!/usr/bin/env python
import random
class ThCredits:
""" Attaches fancy titles to developer roles """
_epithets = [
"nine-tailed %s",
"ordinary %s",
View gist:4055383
#!/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 ],
View gist:3795705
#include <stdio.h>
void swap(int* a, int* b)
{
int tmp = *a;
*a = *b;
*b = tmp;
}
int main(void)
You can’t perform that action at this time.