$ gcc -g -Wall -I /path/to/libuv/include /path/to/libuv/uv.a -framework CoreServices server.c -o server
$ gcc -g -Wall -I /path/to/libuv/include /path/to/libuv/uv.a -framework CoreServices client.c -o client
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
<html> | |
<body> | |
<script> | |
var iframe = document.createElement('iframe'); | |
document.body.appendChild(iframe); | |
var iframe_doc = iframe.contentWindow.document; | |
iframe_doc.write('<html><body><sc' + 'ript>alert(window.location.hash)</sc' + 'ript></body></html>'); | |
</script> | |
</body> | |
</html> |
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
use strict; | |
use warnings; | |
my @lines = <>; | |
print convert( join '', @lines ); | |
sub convert { | |
my $text = shift; | |
$text =~ s/\r//g; |
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
<html> | |
<body> | |
<script type="text/javascript"> | |
var blackhole_image_url = 'http://blackhole.webpagetest.org/', | |
wait_interval = 3000; | |
// 3秒じゃタイムアウトされない | |
loadWithImageElement(blackhole_image_url + 'element.png'); | |
// 3秒じゃタイムアウトされない |
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
(function(define) { | |
define([], function() { | |
'use strict'; | |
var ColorSpace = function() {}; | |
ColorSpace.prototype.HSVtoRGB = function(h, s, v) { | |
var r, g, b; | |
while (h < 0) { |
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 Getopt::Long; | |
use File::Find::Rule; | |
use File::Basename; | |
my $STATE_OK = 0; | |
my $STATE_WARNING = 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
$ perl -MNetAddr::IP -le "print NetAddr::IP->new('192.168.1.0/24')->range" | |
192.168.1.0 - 192.168.1.255 |
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/env perl | |
package TestPack; | |
use strict; | |
use warnings; | |
sub new { | |
my ($class) = @_; | |
return bless {}, $class; | |
} |
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
$ perl -MTime::Piece -le '$t = Time::Piece->strptime("2012-12-10", "%Y-%m-%d"); print $t->strftime("%Y/%m/%d %H:%M:%S")' | |
2012/12/10 00:00:00 |
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
# local -> proxy_host -> web??, db??, etc... を想定 | |
# proxy_user, proxy_user_id_rsa はそれぞれ踏み台サーバのユーザーと鍵 | |
Host web?? db?? | |
ProxyCommand ssh proxy_host nc -w 3600 %h %p | |
User proxy_user | |
IdentityFile ~/.ssh/proxy_user_id_rsa |