Skip to content

Instantly share code, notes, and snippets.

View assafshomer's full-sized avatar

Assaf Shomer assafshomer

View GitHub Profile
Verifying that +coincooler is my openname (Bitcoin username). https://onename.com/coincooler
@assafshomer
assafshomer / gist:92925b2789f6cebf93b7
Last active August 29, 2015 14:21
Toshi Block Subscription to Testnet3
def url(network)
case network.to_sym
when :testnet
return 'wss://testnet3.toshi.io'
when :bitcoin
return 'wss://bitcoin.toshi.io'
else
return "'ws://localhost:5000'"
end
end
@assafshomer
assafshomer / gist:225862b0531beeb1a628
Created May 14, 2015 10:57
Toshi Transaction Subscription on Testnet3
def url(network)
case network.to_sym
when :testnet
return 'wss://testnet3.toshi.io'
when :bitcoin
return 'wss://bitcoin.toshi.io'
else
return "'ws://localhost:5000'"
end
end
@assafshomer
assafshomer / gist:5f47ddbff9b0dd5bc31a
Created May 14, 2015 10:58
Toshi Block Subscription on the Bitcoin Network
def url(network)
case network.to_sym
when :testnet
return 'wss://testnet3.toshi.io'
when :bitcoin
return 'wss://bitcoin.toshi.io'
else
return "'ws://localhost:5000'"
end
end
@assafshomer
assafshomer / colored-coins-encoding.rb
Last active August 29, 2015 14:22
Colored Coins Precision Encoding Scheme
require 'terminal-table'
MAX_SATOSHIS = 21*(10**6)*(10**8)
def max_num(mantis_bits,available_bits)
mantis(mantis_bits)*(10**exponent(mantis_bits,available_bits))
end
def mantis(mantis_bits)
2**mantis_bits
require 'terminal-table'
def max_num(mantis_bits,available_bits)
mantis(mantis_bits)*(10**exponent(mantis_bits,available_bits))
end
def mantis(mantis_bits)
2**mantis_bits
end
# Make sure to first bundle install gem 'terminal-table'
require 'terminal-table'
MAX_EXP = 16
def max_num(mantis_bits,available_bits)
mantis(mantis_bits)*(10**exponent(mantis_bits,available_bits))
end
@assafshomer
assafshomer / gist:6c704f5759927212e714
Created October 8, 2015 10:07
colored coins asset verification
Verifying issuance of colored coins asset with asset_id: [LJEC6Q2h9JKNvZqEC87TbEXvxm4br1uivb2QX]
@assafshomer
assafshomer / gist:aef0d0364ead3dc9b186
Created October 13, 2015 13:08
Colored Coins Asset Verification
Verifying issuance of colored coins asset with asset_id: [LGbocSa7jQ6egewe3bmEkqjFUEDvY6c4xetMR]
@assafshomer
assafshomer / gist:1c214aa9d1a74133bec3
Last active December 7, 2015 11:04
Colored coins asset verifications
Verifying issuance of colored coins asset with ID #U3uPyQeyNRafPy7popDfhZui8Hsw98B5XMUpP
Verifying issuance of colored coins asset with ID #LKUYHRCMbqUNgfNCGFnXv1AvB5Pv8Lkk2EjoF
Verifying issuance of colored coins asset with ID #U9a36XP1UwL5pxaYYiZYJ86sUqWAJ2dGbLaer
Verifying issuance of colored coins asset with ID #LE2v9RbnNr6EJFArY5HZYEeWZgQppxaEEu7XL
Verifying issuance of colored coins asset with ID #LH4noQ7f8dF2Q2jySihJTjK9NpoEKJ8sY575A
Verifying issuance of colored coins asset with ID #LHEQJbm21GGzpHzwwuoraZUQ8LuApHXRqCrwk