Skip to content

Instantly share code, notes, and snippets.

Cayman wemeetagain

Block or report user

Report or block wemeetagain

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .vimrc
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
View ssz_benchmark.js
const Benchmark = require('benchmark')
const ssz = require('../ssz-js/src')
const {serialize, deserialize, hashTreeRoot} = require('../ssz-ts/lib')
const suite = new Benchmark.Suite
const SubObj = {
fields: [
['x', 'uint8'],
['y', 'uint16'],
@wemeetagain
wemeetagain / bigint_vs_bn_vs_number.js
Last active Feb 11, 2019
BigInt vs BN.js vs number benchmark
View bigint_vs_bn_vs_number.js
const Benchmark = require('benchmark')
const BN = require('bn.js')
const suite = new Benchmark.Suite
// native numbers
let num_a, num_b
// BN.js numbers
let bn_a, bn_b
// native BigInt numbers
@wemeetagain
wemeetagain / bn_vs_number.js
Last active Feb 11, 2019
BN vs number benchmark
View bn_vs_number.js
const Benchmark = require('benchmark')
const BN = require('bn.js')
const suite = new Benchmark.Suite
let num_a, num_b
let bn_a, bn_b
const randInt = () => Math.floor(Math.random() * 2**24)
@wemeetagain
wemeetagain / export-layers-to-pdf.py
Created Apr 16, 2018
GIMP plugin - Export Layers to PDF
View export-layers-to-pdf.py
#!/usr/bin/env python
#
# Author: helour
# Copyright: 2013-2015 helour
# Based on the cr33dog's script Export Layers as PNG (http://registry.gimp.org/node/18440)
# License: GPL v3+
#
# Version: 0.7.1
#
# GIMP plugin to export layers as a multiple pages PDF file
@wemeetagain
wemeetagain / multi-addr-identity.lll
Created Aug 6, 2014
Multi-address Identity Contract
View multi-addr-identity.lll
;; multi-addr identity with address voting
;;
;; addresses have 4 commands (transaction types):
;; - vote_add(address,category,permission,lifespan)
;; - tx.data[0]==0
;; - This initiates a vote for `address` to be added to the member list.
;; This only works on addresses with a stored state of none(0) or
;; adding(1). If the vote total for `address` reaches 50% of voting
;; members, `address` is added to the member list. The category,
;; permission, lifespan args are optional once vote has been started.
View gist:ef1049f2f594e69f4223
Verifying myself: My Bitcoin username is +wemeetagain. https://onename.io/wemeetagain
View gist:10010923
if tx.sender != CONTRACTCREATOR:
stop
if tx.data[0] == 0:
contract.storage[1000+tx.value[1]] = tx.value[2]
elif tx.data[0] == 1:
suicide(CONTRACTCREATOR)
View gist:10010830
// data[0] = topic
// data[1] = message
if tx.data[0]:
NEXTINDEX = contract.storage[sha3(tx.data[0])]
contract.storage[sha3(tx.data[0]) + 1 + NEXTINDEX] = tx.data[1]
contract.storage[sha3(tx.data[0])] = NEXTINDEX + 1
View gist:10010529
if tx.sender == CONTRACTCREATOR:
if tx.data[0] == 1:
suicide(CONRACTCREATOR)
else:
NEXTINDEX = contract.storage[999]
contract.storage[1000 + NEXTINDEX] = tx.data[0]
contract.storage[999] = NEXTINDEX + 1
You can’t perform that action at this time.