This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$result = []; | |
foreach (range(1, 10000) as $i) { | |
$total = 0; | |
foreach (range(1, 10000) as $k) { | |
$total += rand(0, 1); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
output = subprocess.check_output("echo Hello World | cat", shell=True) | |
print(output) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'digest/sha2' | |
i = 1 | |
loop do | |
hash = Digest::SHA256.hexdigest(i.to_s) | |
puts "#{i}: #{hash}" | |
if hash.index("0000000") == 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'digest/sha2' | |
file = File.read("./transaction-block.txt") | |
def header(val) | |
puts "==========================================" | |
puts " #{val}" | |
puts "==========================================" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
前回のハッシュ値 | |
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 送りました。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install fabric | |
fab -V | |
# pipが入ってない場合は以下を実行。 | |
easy_install pip | |
fab -l | |
#リモートホストに、「localhost」「127.0.0.1」を指定 | |
fab -H localhost,127.0.0.1 hello |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install fabric | |
wget https://gist.githubusercontent.com/chikaram/17f80c6867b34e85e11d/raw/fabfile.py | |
fab ls_upper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ls | pyp "p.upper()" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install pyp |
NewerOlder