Skip to content

Instantly share code, notes, and snippets.

Jonas Nick jonasnick

Block or report user

Report or block jonasnick

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 bitcoin-cli-wrapper.sh
# bitcoin-cli wrapper for running c-lightning with a pruned Bitcoin node
# (EXPERIMENTAL). It forwards all requests to bitcoind. If a getblock request fails,
# blockstream.info is queried instead. If your prune setting is high enough (2 weeks
# = 2016?) using this wrapper SHOULDN'T have security implications because the
# important blocks are still queried through your own bitcoind.
# Tested with c-lightning 0.6.2. Set the --bitcoin-cli=PATH option in c-lightning to
# the path of this file to use it.
BCLI=bitcoin-cli
getblock() {
View Makefile
main main.gcno: main.c
gcc --coverage -O0 -o main main.c -I../secp256k1/include
main.gcda: main
./main
main.c.gcov: main.gcda
gcov main
coverage.info: main.c.gcov
View gist:105092f5ad81c9787a3f
g6Rib2R5hqhkZXRhY2hlZMOpaGFzaF90eXBlCqNrZXnEIwEgaxWcsVQJ2ThIpV5KbmxzG9UueIUhS/kjIK0vRl/dj7MKp3BheWxvYWTFAup7ImJvZHkiOnsia2V5Ijp7ImVsZGVzdF9raWQiOiIwMTAxNzc5NTQxZmY0YWFkOGIwMGUzMDNhZjk2ZmY1MTVhMDJkN2QxNDhiZDQwMGY3NjI4NmFlM2ZmMjU1OWQ4NDJiZjBhIiwiaG9zdCI6ImtleWJhc2UuaW8iLCJraWQiOiIwMTIwNmIxNTljYjE1NDA5ZDkzODQ4YTU1ZTRhNmU2YzczMWJkNTJlNzg4NTIxNGJmOTIzMjBhZDJmNDY1ZmRkOGZiMzBhIiwidWlkIjoiYzRhNDUxZGFjNzdmYWE4YTM5ZGUwYmE3YTkyMDg1MTkiLCJ1c2VybmFtZSI6ImpuaWNrIn0sInNlcnZpY2UiOnsibmFtZSI6ImdpdGh1YiIsInVzZXJuYW1lIjoiam9uYXNuaWNrIn0sInR5cGUiOiJ3ZWJfc2VydmljZV9iaW5kaW5nIiwidmVyc2lvbiI6MX0sImNsaWVudCI6eyJuYW1lIjoia2V5YmFzZS5pbyBnbyBjbGllbnQiLCJ2ZXJzaW9uIjoiMS4wLjEwIn0sImN0aW1lIjoxNDU0Nzg3NzQ1LCJleHBpcmVfaW4iOjUwNDU3NjAwMCwibWVya2xlX3Jvb3QiOnsiY3RpbWUiOjE0NTQ3ODc2NTUsImhhc2giOiI0ZDA3NDA1YTQ4MzNlNzIwMWJjZjRiNjQzMDkxZjRjMDYzMDQ2ZTdjNWI2YTYzODg0MmI4YWMyNTMyZDMzYWQxOGFkNDkzZjc0YWViNzQ5OTdhNDEzMjYzNDE5MDk2MjdkMmU4ZDViNWRmMDFlNWE4MmY3YjRlYzliMGE5NzFlOCIsInNlcW5vIjozNzM0MjV9LCJwcmV2IjoiN2I0ODQ1MGUyNjY3OTYwYjcyYzcxMWEzY2I2OGI1OWE0MTcx
View fix_infinite_hello.patch
From ca9c781a458818f505b11c566d1bdd9c41dd9ab9 Mon Sep 17 00:00:00 2001
From: jonasnick <jonasd.nick@gmail.com>
Date: Sun, 4 May 2014 23:19:37 +0200
Subject: [PATCH] Fixes infinite hello request/reply messages in networks with
>2 nodes.
---
node/crypto2crypto.py | 31 +++++++++++++++++++++----------
1 file changed, 21 insertions(+), 10 deletions(-)
View redirect_screen.sh
#!/bin/sh
# sends every input character to the specified screen
screen_name=t1
while read -r char
do
screen -S $screen_name -X stuff "$char"
done
View gist:10295467
@Test
public void testDelete() {
StorageRootInMemory storage = new StorageRootInMemory(ZooConfig.getFilePageSize());
StorageChannelOutput out = storage.getWriter(false);
int pageId = out.allocateAndSeek(DATA_TYPE.GENERIC_INDEX, 0);
out.writeShort((short) -1);
out.flush();
assertEquals(2, storage.statsGetPageCount());
@jonasnick
jonasnick / bca.php
Last active Oct 9, 2018
Blog Comments in Activity (bca) Shows blog post comments in buddypress' activity stream. Does currently not keep track of editing or removing comments.
View bca.php
<?php
/*
* Blog Comments in Buddypress Activity
* WARNING: Test thoroughly if it works in your environment before using in production code.
* LICENSE: Public domain
*/
/*
* When a new comment gets added to the database, add this comment to the
You can’t perform that action at this time.