I hereby claim:
- I am fukaoi on github.
- I am fukaoi (https://keybase.io/fukaoi) on keybase.
- I have a public key ASCUo-T8fcPOYbwnpufKBq85MsJs_sMYCq8i3C1Hxx-h3Qo
To claim this, I am signing this object:
| abstract class Parent #同じシグネチャなので、abstractを通して、制約をつける | |
| abstract def disp | |
| end | |
| class A < Parent | |
| def disp : String | |
| "call A" | |
| end | |
| end |
| class A | |
| def disp : String | |
| "call A" | |
| end | |
| end | |
| class B | |
| def disp : String | |
| "call B" | |
| end |
| ### これだとMacro?生成ができないのか、 ``` undefined constant Crystal::Env``` | |
| ### [NG] | |
| require "env" | |
| ### 代替手段 | |
| ### [OK] | |
| require "env/core" |
| module Demo | |
| STRUCT = [ | |
| Bool, Char, Symbol, | |
| Int8, Int16, Int32, Int64, Int128, | |
| Float32, Float64 | |
| ] | |
| macro define_struct | |
| {% for s in STRUCT %} | |
| struct {{ s.id }} |
| ## default | |
| >electrum-ltc create --testnet -w ~/Desktop/wallet | |
| <<Password (hit return if you do not wish to encrypt your wallet): | |
| >>test | |
| <<Confirm: | |
| >>test | |
| ## set env parameter |
| docker run -d -p 5432:5432 -v /var/run/postgresql/:/var/run/postgresql/ --name mypost postgres |
I hereby claim:
To claim this, I am signing this object:
| class String | |
| def unpack(format : String) : Array | |
| io = IO::Memory.new(self) | |
| slice = Bytes.new(self.size) | |
| io.read(slice) | |
| [slice.hexstring] | |
| end | |
| end | |
| class Array |
| const exec = require('child_process').exec; | |
| var obj = { | |
| "name":"太郎", | |
| "age": 30, | |
| "area":"Tokyo" | |
| } | |
| const json = JSON.stringify(JSON.stringify( obj )); | |
| console.log(json) |
| require "io" | |
| require "json" | |
| io = IO::Memory.new | |
| Process.run("cat ~/Work/hogepipe", shell: true, output: io) | |
| p data = io.to_s.chomp | |
| p JSON.parse(data)["name"] |