Skip to content

Instantly share code, notes, and snippets.

View braydonf's full-sized avatar

Braydon Fuller braydonf

View GitHub Profile
@braydonf
braydonf / interpreter.patch
Created March 15, 2016 01:21
interpreter.patch
commit 6aa9fc335a11eb1d177d73cb8a2df4ccf35be247
Author: Braydon Fuller <[email protected]>
Date: Mon Mar 14 21:16:40 2016 -0400
script: interpreter fixes
diff --git a/lib/script/interpreter.js b/lib/script/interpreter.js
index e7e164b..275f820 100644
--- a/lib/script/interpreter.js
+++ b/lib/script/interpreter.js
@braydonf
braydonf / bitcoin-uri-handling.md
Created April 27, 2016 02:25
setting up bitcoin handling for local bitcoin install
[Desktop Entry]
Type=Application
Name=Bitcoin-QT
GenericName=Bitcoin Client
Comment=Bitcoin wallet
Categories=Qt;Network;
Exec=/usr/local/bin/bitcoin-qt %u
Icon=bitcoinicon
StartupNotify=false
@braydonf
braydonf / lmdb-test.js
Last active September 28, 2016 16:41
lmdb-test.js
describe('Cursors (utf16 string key and binary value)', function() {
this.timeout(10000);
var env;
var dbi;
var total = 10;
before(function() {
env = new lmdb.Env();
env.open({
path: testDirPath,
maxDbs: maxDbs,
@braydonf
braydonf / libnettle-aes-256-ctr.c
Last active June 25, 2019 01:28
libnettle aes 256 ctr example encrypt/decrypt
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <nettle/aes.h>
#include <nettle/ctr.h>
int main() {
struct aes256_ctx *ctx = malloc(sizeof(struct aes256_ctx));
@braydonf
braydonf / uv_cancel_example.c
Last active February 6, 2020 16:09
libuv example for cancelling queued work
// An implementation of what is decribed at:
// https://nikhilm.github.io/uvbook/threads.html#id1
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
#include <uv.h>
---
configure.ac | 2 +-
tests/run_wine.bash | 5 +++++
tests/strerror_override.c | 3 +++
tests/test1.c | 2 +-
tests/test_util_file.c | 10 ++++------
5 files changed, 14 insertions(+), 8 deletions(-)
create mode 100755 tests/run_wine.bash
diff --git a/configure.ac b/configure.ac
From f9e4e11063bb7ddda4c05c061e1f8b4ee29a1be4 Mon Sep 17 00:00:00 2001
From: Braydon Fuller <[email protected]>
Date: Sun, 5 Feb 2017 01:20:23 -0500
Subject: [PATCH] tests with mingw
---
tests/test1.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/tests/test1.c b/tests/test1.c
@braydonf
braydonf / bench-redis-memcached-mongodb.js
Last active April 5, 2017 22:18
bench-redis-memcached-mongodb.js
/*
"dependencies": {
"benchmark": "^2.1.4",
"memcached": "^2.2.2",
"mongodb-core": "^2.1.9",
"redis": "^2.7.1"
}
*/
const redis = require('redis');
@braydonf
braydonf / memory-mapped-test.c
Last active April 11, 2017 09:32
testing memory mapped files
#include <stdio.h>
#include <errno.h>
#include <stdint.h>
#ifdef _WIN32
#include <windows.h>
#include <io.h>
#else
#include <sys/mman.h>
#endif
@braydonf
braydonf / allocate-file-test.c
Last active April 11, 2017 05:34
allocate file test
#define _GNU_SOURCE
#ifdef _WIN32
#include <windows.h>
#endif
#include <errno.h>
#include <fcntl.h>
#include <stdint.h>
#include <stdio.h>