Skip to content

Instantly share code, notes, and snippets.

View chikaram's full-sized avatar

Chikara (Riki) Miyake chikaram

  • Ho Chi Minh City, Vietnam
View GitHub Profile
<?php
$result = [];
foreach (range(1, 10000) as $i) {
$total = 0;
foreach (range(1, 10000) as $k) {
$total += rand(0, 1);
}
import subprocess
output = subprocess.check_output("echo Hello World | cat", shell=True)
print(output)
require 'digest/sha2'
i = 1
loop do
hash = Digest::SHA256.hexdigest(i.to_s)
puts "#{i}: #{hash}"
if hash.index("0000000") == 0
require 'digest/sha2'
file = File.read("./transaction-block.txt")
def header(val)
puts "=========================================="
puts " #{val}"
puts "=========================================="
end
前回のハッシュ値
000001f034e5b0e4f0fd28e522b49757d1ddea3e4653302285d8a4a4c6361975
取引一覧
1: EさんがAさんに 0.52BTC 送りました。
2: DさんがBさんに 0.08BTC 送りました。
3: DさんがCさんに 0.12BTC 送りました。
4: CさんがDさんに 0.34BTC 送りました。
5: BさんがAさんに 0.05BTC 送りました。
6: AさんがCさんに 0.06BTC 送りました。
@chikaram
chikaram / fab.sh
Last active August 29, 2015 14:10
pip install fabric
fab -V
# pipが入ってない場合は以下を実行。
easy_install pip
fab -l
#リモートホストに、「localhost」「127.0.0.1」を指定
fab -H localhost,127.0.0.1 hello
pip install fabric
wget https://gist.githubusercontent.com/chikaram/17f80c6867b34e85e11d/raw/fabfile.py
fab ls_upper
from fabric.api import *
from fabric.colors import *
def install_pyp():
local('pip install pyp')
def ls_upper():
output = local('ls | pyp "p.upper()"', capture=True)
print blue(output, bold=True)
ls | pyp "p.upper()"
pip install pyp