Skip to content

Instantly share code, notes, and snippets.

View rocky's full-sized avatar

R. Bernstein rocky

View GitHub Profile
vmyth -v 1 -x coe.sol
22:07:33 INFO Analyzing contract coe.sol:Target
22:07:33 INFO LASER EVM initialized with dynamic loader: None
22:07:33 INFO - Entering function Target:unknown
22:07:33 INFO - Entering function Target:unknown
22:07:40 INFO - Entering function Target:unknown
22:07:41 INFO - Entering function Target:unknown
22:07:41 INFO - Entering function Target:unknown
22:07:41 INFO - Entering function Target:unknown
22:07:41 INFO - Entering function Target:unknown
@rocky
rocky / readme.md
Created March 4, 2018 19:46
Subset Sum

Problem

Output the largest unique set of characters that can be removed from this paragraph without letting its length drop below 50.

Algorithm Idea

There is a simple greedy algorithm approach to solving this: consider

@rocky
rocky / test-bytecode.lap
Created October 9, 2017 21:37
Emacs Lisp bytecode disassembly for keyboard bindings
byte code:
args: nil
0 constant global-set-key
1 constant ""
2 constant backward-delete-char-untabify
3 call 2
4 discard
5 constant local-set-key
6 constant "m"
7 constant vm-mail
@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
@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 / 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 <rocky@gnu.org>
#
# 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 / Emacs25-build.png
Last active October 17, 2015 09:53
Emacs 25 build profile
Emacs25-build.png
@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.

__docformat__ = 'restructuredtext'
__all__ ['api']
@rocky
rocky / README.txt
Created July 24, 2015 03:13
Simple websocket code in nodejs
sudo npm install -g websocket