Skip to content

Instantly share code, notes, and snippets.

#!/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');
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
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
}
@yappo
yappo / lnyappo.pl
Created April 7, 2016 18:31
ikachan for LINE
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;
@yappo
yappo / trigger.sql
Last active September 18, 2015 07:07
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;
use strict;
use warnings;
use Furl;
my $furl = Furl->new( agent => 'Moznion/1.0' );
my $wait = 3;
my %last_vote_counts;
while (1) {
@yappo
yappo / gfx.pl
Last active August 29, 2015 13:58
#!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(
#!/usr/bin/env perl
use strict;
use warnings;
use v5.10;
use AnyEvent;
use Benchmark ':all';
use DBI;
use Parallel::ForkManager;
use IO::Select;
# 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);