Skip to content

Instantly share code, notes, and snippets.

for (var i = 0; i < questionArr.length; i++) {
var qa = $.grep(questionArr[i].split(/\n/), function(n){
return n !== '' && ! n.match(/^\(0\)/);
});
qa[0] = qa[0].replace(/^(.+)_(ANT|SYN)$/, function(){
return '「' + RegExp.$1 + '」の' + (RegExp.$2 === 'ANT' ? '対' : '類') + '義語は';
});
qa[1] = qa[1].replace(/^\(1\)(.+)/,'「$1」');
console.log(qa.join(''));
}
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Furl;
use JSON::XS;
use Digest::SHA1 qw(sha1_hex);
use Time::HiRes qw(gettimeofday);
use Time::Local;
@nipotan
nipotan / tif2016-to-ical.pl
Last active July 21, 2016 01:22
tokyo idol festival 2016 timetable exporter
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Furl;
use JSON::XS;
use Digest::SHA1 qw(sha1_hex);
use Time::HiRes qw(gettimeofday);
use Time::Local;
@nipotan
nipotan / p5-evernote2simplenote.pl
Created July 4, 2016 12:43
evernote 2 simplenote without app_key
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use DBI;
use Encode;
use File::Spec;
use Config::Pit;
use Log::Any::Adapter ('Stdout');
// ==UserScript==
// @name pancrase derby result presentation
// @namespace http://nipotan.com/
// @version 0.1
// @description パンクラスダービーの過去の投票結果がよくわからないやつをどうにかする
// @author nipotan
// @match https://derby.pancrase.co.jp/story/*
// @grant none
// ==/UserScript==
(function() {
@nipotan
nipotan / Acme-Lou.patch
Created January 22, 2016 10:24
modified to handle the first mecab node rightly for Acme::Lou
--- Lou.pm.orig 2007-02-01 19:08:45.000000000 +0900
+++ Lou.pm 2016-01-22 19:18:52.144838848 +0900
@@ -116,7 +116,7 @@
$text = encode($self->{mecab_charset}, $text);
my @out;
my $node = $self->mecab->parse($text);
- while ($node = $node->next) {
+ while ($node) {
my $n = $self->decode_node($node);
#!/usr/bin/env perl
use strict;
use warnings;
use Chart::Gnuplot;
use Time::Piece;
use Time::Seconds;
my @x = ();
my @y = ();
@nipotan
nipotan / luceTW
Created December 22, 2015 04:58
「Luce」「Twinkle」「Wink」「☆」をランダムに表示し、「Luce Twinkle Wink☆」が完成したら Set Up して終了するプログラム
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
{
binmode STDOUT, ':utf8';
local $| = 1;
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
binmode STDOUT, ':utf8';
# マスコミのまわりくどい言い方
my $マスコミの皆様 = "テレビ局やラジオ局、新聞社、通信社、週刊誌や漫画・アニメ等出版社、インターネット新聞・テレビやブログ・ツイッター・フェイスブック等、フリージャーナリスト等全てのマスコミ、報道機関等に関係される皆様";
#!/usr/bin/env perl
use strict;
use warnings;
use Plack::Request;
# run `plackup pinknoise.psgi` and access to http://0:5000/?s=<second> via browser
my $app = sub {
my $req = Plack::Request->new(shift);