Skip to content

Instantly share code, notes, and snippets.

@blueplanet
blueplanet / file0.js
Last active December 6, 2017 22:37
コントラクトの関数を呼び出す際起こったこと ref: https://qiita.com/blueplanet/items/af9dd28d81b4c238ad30
contract SingleNumRegister {
uint storedData;
function set(uint x) {
storedData = x;
}
function get() constant returns (uint retVal) {
return storedData;
}
}
@blueplanet
blueplanet / file0.txt
Created December 5, 2017 20:42
イーサリアムのブロックその2 ref: https://qiita.com/blueplanet/items/a7c3f7551b238fbd79c1
receipts_root: ???
logs_bloom: ???
@blueplanet
blueplanet / file0.js
Last active May 21, 2019 01:27
Browser Solidityでスマートコントラクトをデプロイする際ハマったこと ref: https://qiita.com/blueplanet/items/d6cd9c9503bb59fb8dda
pragma solidity ^0.4.0;
contract TestTranster {
address public ownerAddress;
function TestTranster(address _ownerAddress) public {
ownerAddress = _ownerAddress;
}
}
@blueplanet
blueplanet / add-new-crypto-to-peatio.md
Last active September 12, 2017 20:19 — forked from brossi/add-new-crypto-to-peatio.md
Adding A New Cryptocurrency to Peatio

State: Draft
Based on the Peatio Stable branch


Coin Daemon

To the coin daemon's {coin}.conf file, include the -walletnotify command:

# Notify when receiving coins
@blueplanet
blueplanet / ecdsa_example.rb
Created August 19, 2017 14:19 — forked from ostinelli/ecdsa_example.rb
ECDSA usage from Ruby.
require 'openssl'
require 'base64'
# ===== \/ sign =====
# generate keys
key = OpenSSL::PKey::EC.new("secp256k1")
key.generate_key
public_key = key.public_key
public_key_hex = public_key.to_bn.to_s(16).downcase # public key in hex format
@blueplanet
blueplanet / README.md
Created January 17, 2017 07:58 — forked from hidakatsuya/README.md
Barby で作ったバーコードのサイズを調整する方法

Barby で作ったバーコードのサイズを調整するサンプルコード

動作確認環境

  • Mac OSX 10.8
  • Ruby 2.0.0-p195
  • ThinReports 0.7.6
  • barby 0.5.1
  • chunky_png 1.2.8
@blueplanet
blueplanet / gist:54fb96723a433a3ad00c395db3b6d987
Created December 26, 2016 08:40
[WIP]ActiveHash with Many to Many
require 'active_record'
require 'active_hash'
require 'minitest/autorun'
ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ':memory:'
ActiveRecord::Base.connection.instance_eval do
create_table(:posts) do |t|
t.string :name
end
@blueplanet
blueplanet / sti.rb
Last active December 20, 2016 20:58
Rails STI
require 'active_record'
require 'minitest/autorun'
ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ':memory:'
ActiveRecord::Base.connection.instance_eval do
create_table(:cars) do |t|
t.string :name
t.string :type
t.string :bicycle_column1
@blueplanet
blueplanet / file0.txt
Created November 22, 2016 01:04
Heroku で Let's Encrypt 無料証明書を使う(自動更新あり) ref: http://qiita.com/blueplanet/items/b85634a0ced219e9ebe7
gem 'platform-api', github: 'jalada/platform-api', branch: 'master'
gem 'letsencrypt-rails-heroku', group: 'production'
@blueplanet
blueplanet / file0.txt
Created June 19, 2016 11:46
REDIS_URL環境変数は'redis://hostname:6379'のようにスキマー(redis://)を含めるほうが良いお話 ref: http://qiita.com/blueplanet/items/b72be9dc349ec7f15cba
# config/application.rb
config.cache_store = :redis_store, 'redis://localhost:6379/1/redis_try/cache', { expires_in: 90.minutes }