Skip to content

Instantly share code, notes, and snippets.

@jhoenicke
jhoenicke / break-short.c
Created April 6, 2017 09:31
Program to brute force private keys from public keys using the baby-step giant-step algorithm.
/**********************************************************************
* Copyright (c) 2017, Jochen Hoenicke *
* *
* Compile with: *
* gcc -O2 -I secp256k1/src/ -I secp256k1/ break_short.c -lgmp *
**********************************************************************/
#include "libsecp256k1-config.h"
#include <stdio.h>
@peterellisjones
peterellisjones / Chess Perft test positions
Last active January 31, 2024 02:21
Test positions for debugging chess engines. Formatted as JSON array of FEN strings
[
{
"depth":1,
"nodes":8,
"fen":"r6r/1b2k1bq/8/8/7B/8/8/R3K2R b KQ - 3 2"
},
{
"depth":1,
"nodes":8,
"fen":"8/8/8/2k5/2pP4/8/B7/4K3 b - d3 0 3"
@dyno
dyno / pbopen.py
Created January 17, 2017 17:55
drop-in replacement of file object line iterator with tqdm progress bar
#!/usr/bin/env python
from contextlib import contextmanager
from os.path import getsize, basename
from tqdm import tqdm
@contextmanager
def pbopen(filename):
total = getsize(filename)