Skip to content

Instantly share code, notes, and snippets.

/*
* QIMalloc - Quick, incremental malloc.
*
* This is a dummy malloc implementation, without the option to free memory space.
*/
static int __malloc_ptr = 0;
static int __malloc_end = 0;
void *malloc(size_t size) {
@locktemp997
locktemp997 / traverser.py
Last active February 27, 2018 19:53
Nano Ledger/LMDB Account parsing (computes balance of account at every send and receive block, identifies send and receive address + amounts, stores to file)
######NOTE#######
#This script was written in python 2.7... no guarantees it works on python 3 without modification.
import lmdb
from pyblake2 import blake2b
import matplotlib.pyplot as plt
#CHANGE THIS TO YOUR DATABASE LOCATION (usually /home/user/RaiBlocks/)
#ALSO!! Python doesn't see the database unless it has extension .mdb
#however your nano-node/wallet won't see it unless it stays named as .ldb
#I suggest creating a symlink as follows: ln -s /PATH/TO/YOUR/DATABASE/data.ldb /PATH/TO/YOUR/DATABASE/data.mdb
@mkuklis
mkuklis / gist:3747385
Created September 19, 2012 02:53
CORS with express, redis as session store and zepto
// server
// redis client
var redisClient = redis.createClient(process.env.REDIS_PORT, process.env.REDIS_HOST);
redisClient.auth(process.env.REDIS_PASS);
// redis session store
var session = {
secret: 'your_secret',
store: new RedisStore({ client: redisClient })
@guerrerocarlos
guerrerocarlos / main.js
Created September 6, 2012 05:07
loading socket.io using require.js
// Require.js allows us to configure shortcut alias
require.config({
// The shim config allows us to configure dependencies for
// scripts that do not call define() to register a module
shim: {
'socketio': {
exports: 'io'
},
'underscore': {
exports: '_'