Skip to content

Instantly share code, notes, and snippets.

Avatar

Wladimir J. van der Laan laanwj

  • The Netherlands
View GitHub Profile
View host_icons.example
{
"path":"/home/foo/icons/",
"domain":"example.com",
"icons":[
{"host":"aaa.example.com", "icon":"red.png"},
{"host":"bbb.example.com", "icon":"green.png"},
{"host":"ccc.example.com", "icon":"yellow.png"},
{"host":"ddd.example.com", "icon":"orange.png"},
{"host":"eee.example.com", "icon":"blue.png"},
{"host":"fff.example.com", "icon":"cyan.png"},
@laanwj
laanwj / hexstr_benchmarks.cpp
Created Apr 21, 2012
Bitcoin HexStr benchmarks
View hexstr_benchmarks.cpp
// g++ -O2 hexstr_benchmarks.cpp -o hexstr_benchmarks
#include <stdio.h>
#include <vector>
#include <string>
#include <stdarg.h>
#include <time.h>
#include <string.h>
using namespace std;
#define loop for (;;)
@laanwj
laanwj / bignum_setcompact.cpp
Created Sep 21, 2012
Checks for all 32 bit integers whether SetCompactNew(x) == SetCompactOld(x)
View bignum_setcompact.cpp
// g++ bignum_setcompact.cpp -o ./bignum_setcompact -lcrypto -O3
// Checks for all 32 bit integers whether SetCompactNew(x) == SetCompactOld(x)
#include <limits>
#include <stdexcept>
#include <vector>
#include <openssl/bn.h>
#include <algorithm>
#include <assert.h>
#include <sys/types.h>
@laanwj
laanwj / haskell-unicode.sublime-keymap
Created Sep 22, 2012
Haskell unicode syntax key bindings for Sublime Text 2
View haskell-unicode.sublime-keymap
[
{ "keys": [":",":"], "command": "insert_snippet", "args": {"contents": "∷"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "source.haskell" }
]
},
{ "keys": ["-",">"], "command": "insert_snippet", "args": {"contents": "→"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "source.haskell" }
]
View gist:4464490
[seq 0] [thread 0] in={
.command = gcvHAL_GET_BASE_ADDRESS,
.u = {
}
}
[seq 1] [thread 0] out={
.command = gcvHAL_GET_BASE_ADDRESS,
.status = gcvSTATUS_OK,
.u = {
.GetBaseAddress = {
@laanwj
laanwj / texinfo_kobo.tex
Created Jun 14, 2013
Texinfo.tex configuration for generating PDFs readable with Kobo Glo 6" screen size
View texinfo_kobo.tex
\def\afivepaper{{\globaldefs = 1
\parskip = 2pt plus 1pt minus 0.1pt
\textleading = 12.5pt
%
\internalpagesizes{111mm}{94mm}%
{-.5in}{-.85in}%
{0pt}{8pt}%
{127mm}{100mm}%
\lispnarrowing = 0.2in
\tolerance = 800
View float3_mul_default.bin
MOV t0.x___, void, void, t0.xxxx
MOV t0._y__, void, void, t0.xxxx
BRANCH.GE void, t0.yyyy, u0.zzzz, label_20 ; !bit_1_21=1! !bit_2_30=2!
LSHIFT t0._y__, t0.xxxx, void, u0.wwww ; !bit_2_30=1!
LOAD t1._yzw, u0.xxxx, t0.yyyy, void
MOV t0._yzw, void, void, t1.yyzw
LSHIFT t2.x___, t0.xxxx, void, u0.wwww ; !bit_2_30=1!
LOAD t1.xyz_, u0.xxxx, t2.xxxx, void
MOV t2.xyz_, void, void, t1.xyzz
MUL t3.xyz_, t0.yzww, t2.xyzz, void
View bip0038bf.py
# Copyright (c) 2013 W.J. van der Laan
# parts sourced from jackjack's pywallet.py (https://github.com/jackjack-jj/pywallet)
# Distributed under the MIT/X11 software license
from bitcoin.base58 import CBase58Data
from binascii import b2a_hex, a2b_hex
import struct
import hashlib
import scrypt, random
from Crypto.Cipher import AES
@laanwj
laanwj / gist:8580481
Created Jan 23, 2014
Windows Qt 5.2.0 Qt5Gui.pc
View gist:8580481
prefix=/home/ubuntu/staging64
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
Name: Qt5 Gui
Description: Qt Gui module
Version: 5.2.0
Libs: -L${libdir} -lQt5Gui
@laanwj
laanwj / sendalert.cpp
Last active Jul 9, 2018
Bitcoin send alert code
View sendalert.cpp
/*
So you need to broadcast an alert...
... here's what to do:
1. Copy sendalert.cpp into your bitcoind build directory
2. Decrypt the alert keys
copy the decrypted file as alertkeys.h into the src/ directory.
3. Modify the alert parameters in sendalert.cpp
You can’t perform that action at this time.