Skip to content

Instantly share code, notes, and snippets.

View killerstorm's full-sized avatar

Alex Mizrahi killerstorm

View GitHub Profile
class ITOGColorDefinition(GenesisColorDefinition):
CLASS_CODE = 'itog'
class GenesisDesc(object):
def __init__(self, exponent, mantissa):
self.exponent = exponent
self.mantissa = mantissa
@classmethod
def from_value(cls, value):
import qualified Data.Map as Map
type ColorKernel txPayload coinState = txPayload -> [coinState] -> [coinState]
data ColorTx txPayload = ColorTx { payload :: txPayload,
inputIndices :: [Int],
outputIndices :: [Int],
outputCount :: Int}
type TxId = String
var _ = require('lodash')
var bitcore = require('bitcore') // 0.12.5
var network = bitcore.Networks.testnet
var totalKeys = 3
var requiredSignatures = 2
var rawPrivateKeys = [
'cUTyK6kpESjzWRtvzb5KfenFB6PaGofwojkJMx68AQA6t2mQSKmV',
'cVQS3PFi9t1XWXAH2fKs5xczmeXKb5v4ZbwJ8u7vPgK9Xjx9CDts',
var rpc = require('node-json-rpc');
var client = new rpc.Client({
port: 80,
host: "regtest-controller.chromanode.com"
});
client.call({method: 'add_confirmations', params: [1], id: 1},
function(err, res) {
console.log(err || res)
})
if (process.argv.length < 3) {
console.log('need address')
process.exit(1)
}
var rpc = require('node-json-rpc');
var client = new rpc.Client({
port: 80,
host: "regtest-controller.chromanode.com"
});
183 0.5 10 20
253 0.5 7 14
67 1 11 11
298 1 10 10
97 1 8 8
310 3 22 7.3333333333
247 2 13 6.5
221 3 16 5.3333333333
302 3 16 5.3333333333
161 1 5 5
(eval-when (:compile-toplevel :load-toplevel :execute)
(setf (ext:package-lock :ext) nil))
(defun non-alphanumericp (ch)
(not (alphanumericp ch)))
(defvar +hex-chars+ "0123456789ABCDEF")
(declaim (type simple-string +hex-chars+))
@killerstorm
killerstorm / gfile.lisp
Created May 29, 2012 09:39
generic files
(defpackage #:gfile (:use #:cl))
(in-package :gfile)
;; I/O API
(defgeneric read-elt (file position))
(defgeneric write-elt (file position elt))
(defgeneric read-elts (file position count)
(:documentation "Read a sequence of elements."))
@killerstorm
killerstorm / jfli-abcl.diff
Created June 12, 2012 10:20
jfli-abcl, Alex's version
--- /home/alex/jfli-abcl-orig/jfli-abcl/jfli-abcl.lisp 2004-11-20 21:03:04.000000000 +0200
+++ jfli-abcl.lisp 2012-06-12 13:39:51.395315872 +0300
@@ -6,6 +6,10 @@
; the terms of this license.
; You must not remove this notice, or any other, from this software.
+; Ported to ABCL by asimon@math.bme.hu.
+; Minor ABCL fixes by:
+; A. Vodonosov (avodonosov@yandex.ru).
+; Alex Mizrahi (alex.mizrahi@gmail.com)
@killerstorm
killerstorm / colors.cpp
Created September 27, 2012 12:25
Coin coloring algorithm demo
#include <vector>
#include <iostream>
enum color_t {
COLOR_MIXED = -1,
COLOR_UNKNOWN = -2,
COLOR_DEFAULT = 0,
COLOR_RED = 1,
COLOR_BLUE = 2
};