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
def call_block | |
puts "before call" | |
yield | |
yield | |
puts "after call" | |
end | |
call_block{ puts "call" } #before call\ncall\ncall\nafter call | |
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
#clone repl from github or download form http://neugierig.org/software/c-repl/ | |
git clone https://github.com/martine/c-repl.git c-repl | |
#install dependencies | |
sudo apt-get install ghc6 gccxml libghc6-parsec-dev libghc6-mtl-dev \ | |
libghc6-hunit-dev | |
sudo apt-get install gdb libexpat1-dev c2hs libreadline-dev |
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
#0> non-block call | |
Thread.new do | |
blahbla... | |
end | |
#1> 4 simple ways to call shell or cmd | |
`ps aux` |
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 'open-uri' | |
img_url = "http://fffffffffffffffffffffffuuuuuuuuuuuuuuuuuuuuuu.com/big.jpg?im=" | |
(1..1044).each do |x| | |
n = '%.4d' % x + ".jpg" | |
open(n, "wb").write(open(img_url+n).read) | |
end |
NewerOlder