Skip to content

Instantly share code, notes, and snippets.

View rocky's full-sized avatar

R. Bernstein rocky

View GitHub Profile
@rocky
rocky / .gitignore
Last active August 29, 2015 14:12
VEP speedup testing
/_Inline
@rocky
rocky / bug.c
Last active August 29, 2015 14:16
concurrency bug
/** Try to reproduce a problem in accessing hash concurrently */
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <pthread.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
@rocky
rocky / Makefile-step-next.mk
Created July 23, 2015 14:02
remake test for step/next inside a recursive make
.PHONY: done all
# Example to test the ability of step/next to
# step into a recursive make or not.
$(info MAKEFLAGS = $(MAKEFLAGS))
$(info MFLAGS = $(MFLAGS))
all:
$(MAKE) done -f Makefile-step-next.mk
@rocky
rocky / README.txt
Created July 24, 2015 03:13
Simple websocket code in nodejs
sudo npm install -g websocket
__docformat__ = 'restructuredtext'
__all__ ['api']
@rocky
rocky / Moxiebox-rocky.md
Created October 2, 2015 20:47
Adventures in Moxiebox

Adventures in Moxiebox

The good news...

The idea of a secure virtual environment for running contracts is good. Moxie is simple virtual machine with 14 general-purpose registers, a stack pointer and a program counter.

Jeff Garzik has proof-of-concept moxie sandbox called moxiebox. You give it a compiled moxie ELF binary, and a file of input data. You optionally request where to receive a file of output data. The sandbox will will return with an exit code 0 on success and nonzero if there's an error.

@rocky
rocky / Emacs25-build.png
Last active October 17, 2015 09:53
Emacs 25 build profile
Emacs25-build.png
@rocky
rocky / style.zsh
Last active June 3, 2022 02:54
possible zshdb set style code
# -*- shell-script -*-
# "set highlight" debugger command
#
# Copyright (C) 2015 Rocky Bernstein <[email protected]>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2, or
# (at your option) any later version.
#
@rocky
rocky / test-um.py
Last active July 20, 2016 14:32
um
import unittest
from um import Um
class TestUmspec(unittest.TestCase):
def test_bits(self):
x = int('1101', 2)
for start, l, expect in (
(28, 1, 1),
@rocky
rocky / gcd-phase1.lap
Last active October 4, 2017 21:30
Amazing emacs decompilation
# preprocessed disassembly. Fake "LABEL" and "COME_FROM" instructions have been added
0 VARREF a
1 VARREF b
2 GTR
3 GOTO-IF-NIL 1
6 VARREF a
7 VARBIND c
8 VARREF b
9 VARSET a
10 VARREF c