Discover gists
This file contains 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
module BugWalkSimulation | |
describe Bug, "#dead?" do | |
it "should be false when the number of moves is less than the moves lifetime" do | |
bug = new_bug(:moves_lifetime => 3) | |
bug.expects(:number_of_moves).returns(2) | |
bug.should_not be_dead | |
end | |
it "should be true when the number of moves is greater than the moves lifetime" do | |
bug = new_bug(:moves_lifetime => 2) |
This file contains 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
__ _____ ______ ,'´ ̄ ̄ ̄ ̄ ̄ヽ. | |
,´ _,, '-´ ̄ ̄`-ゝ 、_ イ、 | そ .お ご お | | |
'r ´ ヽ、ン、 | れ .風 飯 帰.| | |
,'==─- -─==', i | と 呂 に な | | |
_|\∧∧/|_ i イ iゝ、イ人レ/_ルヽイ i | | も に す さ | | |
\ / レリイi (ヒ_] ヒ_ン ).| .|、i .|| | ・ す る い.| | |
< じ > !Y!"" ,___, "" 「 !ノ i | | ・ る ? .ア | | |
/ \ L.',. ヽ _ン L」 ノ| .| | ・ ? ナ | | |
 ̄|/∨∨\| ̄ | ||ヽ、 ,イ| ||イ| / | タ | | |
レ ル` ー--─ ´ルレ レ´ ヽ、_____ノ |
This file contains 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
_,,....,,_ _人人人人人人人人人人人人人人人_ | |
-''":::::::::::::`''> はやく帰ってね!!! < | |
ヽ::::::::::::::::::::: ̄^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^ ̄ | |
|::::::;ノ´ ̄\:::::::::::\_,. -‐ァ __ _____ ______ | |
|::::ノ ヽ、ヽr-r'"´ (.__ ,´ _,, '-´ ̄ ̄`-ゝ 、_ イ、 | |
_,.!イ_ _,.ヘーァ'二ハ二ヽ、へ,_7 'r ´ ヽ、ン、 | |
::::::rー''7コ-‐'"´ ; ', `ヽ/`7 ,'==─- -─==', i | |
r-'ァ'"´/ /! ハ ハ ! iヾ_ノ i イ iゝ、イ人レ/_ルヽイ i | | |
!イ´ ,' | /__,.!/ V 、!__ハ ,' ,ゝ レリイi (ヒ_] ヒ_ン ).| .|、i .|| | |
`! !/レi' (ヒ_] ヒ_ン レ'i ノ !Y!"" ,___, "" 「 !ノ i | |
This file contains 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
_,,....,,_ _人人人人人人人人人人人人人人人_ | |
-''":::::::::::::`''> ゆっくりしていってね!!! < | |
ヽ::::::::::::::::::::: ̄^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^ ̄ | |
|::::::;ノ´ ̄\:::::::::::\_,. -‐ァ __ _____ ______ | |
|::::ノ ヽ、ヽr-r'"´ (.__ ,´ _,, '-´ ̄ ̄`-ゝ 、_ イ、 | |
_,.!イ_ _,.ヘーァ'二ハ二ヽ、へ,_7 'r ´ ヽ、ン、 | |
::::::rー''7コ-‐'"´ ; ', `ヽ/`7 ,'==─- -─==', i | |
r-'ァ'"´/ /! ハ ハ ! iヾ_ノ i イ iゝ、イ人レ/_ルヽイ i | | |
!イ´ ,' | /__,.!/ V 、!__ハ ,' ,ゝ レリイi (ヒ_] ヒ_ン ).| .|、i .|| | |
`! !/レi' (ヒ_] ヒ_ン レ'i ノ !Y!"" ,___, "" 「 !ノ i | |
This file contains 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
_,,....,,_ _人人人人人人人人人人人人人人人_ | |
-''":::::::::::::`''> だが断る!!! < | |
ヽ::::::::::::::::::::: ̄^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^ ̄ | |
|::::::;ノ´ ̄\:::::::::::\_,. -‐ァ __ _____ ______ | |
|::::ノ ヽ、ヽr-r'"´ (.__ ,´ _,, '-´ ̄ ̄`-ゝ 、_ イ、 | |
_,.!イ_ _,.ヘーァ'二ハ二ヽ、へ,_7 'r ´ ヽ、ン、 | |
::::::rー''7コ-‐'"´ ; ', `ヽ/`7 ,'==─- -─==', i | |
r-'ァ'"´/ /! ハ ハ ! iヾ_ノ i イ iゝ、イ人レ/_ルヽイ i | | |
!イ´ ,' | /__,.!/ V 、!__ハ ,' ,ゝ レリイi (ヒ_] ヒ_ン ).| .|、i .|| | |
`! !/レi' (ヒ_] ヒ_ン レ'i ノ !Y!"" ,___, "" 「 !ノ i | |
This file contains 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
#!/usr/bin/perl | |
use strict; use warnings; | |
use XML::Twig; | |
my $t= XML::Twig->new( twig_handlers => | |
{ | |
'level(2)' => \&filter_doc | |
}, | |
pretty_print => 'indented', | |
output_filter => 'safe' |
This file contains 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
class Foo | |
class Bar | |
end | |
end |
This file contains 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
http://gist.github.com/2118 | |
Unicode handling in Perl. |
This file contains 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
# Authentication | |
def socks_authenticate | |
Socksify::debug_debug "Sending no authentication" | |
write "\005\001\000" | |
Socksify::debug_debug "Waiting for authentication reply" | |
auth_reply = recv(1) | |
if auth_reply[0] != 4 and auth_reply[0] != 5 | |
raise SOCKSError.new("SOCKS version #{auth_reply[0]} not supported") | |
end | |
auth_reply = recv(1) |
This file contains 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 java.io.DataOutputStream; | |
public class PackTest { | |
public static void main (String[] args) throws Exception { | |
DataOutputStream out = new DataOutputStream(System.out); | |
out.writeInt(11351); | |
out.flush(); | |
} | |
} |