Skip to content

Instantly share code, notes, and snippets.

--- bgcanvas.js 2012-06-03 21:30:12.000000000 +0900
+++ bgcanvas2.js 2012-06-05 01:46:19.000000000 +0900
@@ -154,7 +154,7 @@
gradblur.addColorStop(0.9, edgecolor3);
gradblur.addColorStop(1.0, edgecolor4);
ctx.fillStyle = gradblur;
- ctx.arc(this.x, this.y, this.r, 0, Math.PI * 2, true);
+ ctx.arc(this.x, this.y, this.r, 0, 6.283185307179586, true);
ctx.closePath();
ctx.fill();
var JSX = {};
(function () {
/**
* copies the implementations from source interface to target
*/
function $__jsx_merge_interface(target, source) {
for (var k in source.prototype)
if (source.prototype.hasOwnProperty(k))
target.prototype[k] = source.prototype[k];
#!/usr/bin/env tora
/* string section */
say("# string");
my $str = "Hello, Tora";
say($str, $str.length);
/* array section */
say("# array");
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
use Socket;
use IO::Handle;
use autodie;
use 5.12.1;
my $port = 5001;
@xaicron
xaicron / mqh_install.sh
Created December 3, 2011 07:29
Installing MySQL5.1 / Q4M / HandlerSocket
#!/bin/zsh
if [ `which perl` = "/usr/bin/perl" ]; then
echo -n -e "\e[1;31mUSING SYSTEM PERL OK? [y/n]\e[m: "
read ANSWER
if [ "$ANSWER" != "y" ]; then
exit 255
fi
PERL_CPANM_OPT="$PERL_CPANM_OPT --sudo"
fi
use 5.14.0;
package Class::Acessor::Mouse {
use Mouse;
sub import {
my ($class, %args) = @_;
my $meta = Mouse->init_meta(for_class => scalar caller);
for my $type (qw(rw ro wo)) {
next unless ref $args{$type} eq 'ARRAY';
$class->_add_attribute($meta, $type, $args{$type});
use strict;
use warnings;
use Test::More;
use String::Diff;
use Data::Dumper;
use Term::ANSIColor qw(color);
sub is_deeeeeeeeeply {
my ($got, $expects, $desc) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
#!/usr/bin/env perl
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/extlib/lib/perl5";
use lib "$FindBin::Bin/lib";
use Isucon;
use Cache::Memcached::Fast;
use strict;
use warnings;
use Benchmark qw(cmpthese);
my $slash = '/foo';
my $mid = '?foo=bar&hoge=fuga';
my $long = 'foo=bar&hoge=fuga'x100;
print "perl: $^V¥n";
print "OS : $^O¥n";
package S::Exception;
use strict;
use warnings;
use parent qw(Class::Accessor::Fast);
use overload (q|""| => \&to_string);
use Carp qw(croak);
our $VERSION = '0.01';
__PACKAGE__->mk_accessors(qw/message code/);