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 node | |
'use strict' | |
const NOTIFY_TOKEN = 'YOUR LINE NOTIFY TOKEN'; | |
const PubNub = require('pubnub'); | |
const pubnub = new PubNub({ | |
subscribeKey: 'sub-c-52a9ab50-291b-11e5-baaa-0619f8945a4f' | |
}); | |
const exec = require('child_process'); |
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 v5.24; | |
use strict; | |
use warnings; | |
use utf8; | |
my @欲しい = qw( | |
https://twitter.com/ast_j/status/807489960437653504 | |
https://twitter.com/nasa9084/status/807489992117227520 | |
https://twitter.com/yoku0825/status/807490016972681216 | |
https://twitter.com/ichikawa_0829/status/807490026246316032 |
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
export LINE_NOTIFY_SHELL_TOKEN=<YOUR_PERSONAL_ACCESS_TOKEN> | |
function line { | |
pipe=`cat -` | |
message=`echo -e "$@\n$pipe"` | |
echo -e "$message" | |
curl -v -X POST -H "Authorization: Bearer $LINE_NOTIFY_SHELL_TOKEN" -F "message=$message" https://notify-api.line.me/api/notify | |
} |
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; | |
use DBI; | |
use Digest::SHA 'hmac_sha256_base64'; | |
use Encode; | |
use Furl; | |
use JSON::PP; | |
use Plack::Request; | |
use String::Random; |
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
LOCK TABLES lovecall WRITE, dropdb WRITE; | |
DROP TRIGGER lovecall_counter; | |
DELIMITER | | |
CREATE TRIGGER lovecall_counter AFTER INSERT ON lovecall FOR EACH ROW | |
BEGIN | |
UPDATE counter SET lovecall_count = lovecall_count + 1; | |
UPDATE dropdb SET lovecall_count = lovecall_count + 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
use strict; | |
use warnings; | |
use Furl; | |
my $furl = Furl->new( agent => 'Moznion/1.0' ); | |
my $wait = 3; | |
my %last_vote_counts; | |
while (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 -w | |
use strict; | |
use Text::Xslate; | |
use Text::Xslate::Util qw(hash_with_default); | |
my $DEBUG = 1; | |
# bad pratice | |
{ | |
my %vars; | |
my $vars_ref = $DEBUG ? hash_with_default( |
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
ね | |
た | |
ば | |
れ | |
ぼ | |
う | |
し | |
ね | |
た | |
ば |
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 | |
use strict; | |
use warnings; | |
use v5.10; | |
use AnyEvent; | |
use Benchmark ':all'; | |
use DBI; | |
use Parallel::ForkManager; | |
use IO::Select; |
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
# diff lib/Kossy.pm local/lib/perl5/Kossy.pm | pbcopy | |
21c21 | |
< our $VERSION = '0.23'; | |
--- | |
> our $VERSION = '0.25'; | |
43,46c43,53 | |
< my $root_dir = shift; | |
< my @caller = caller; | |
< $root_dir ||= File::Basename::dirname( Cwd::realpath($caller[1]) ); | |
< $self = $self->new($root_dir); |
NewerOlder