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
}
use strict;
use warnings;
use Test::More;
use Text::Xslate;
subtest 'scope ok' => sub {
my $tx = Text::Xslate->new({
syntax => 'TTerse'
});
@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;
# 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);
2013-11-09 11:54:58.239939500 ./
2013-11-09 11:54:58.312218500 data/icon/
2013-11-09 11:54:58.312295500 data/icon/23bc376ae0dcdb1517691c816dd91b80b67e178ce6b663dad69ff42a73dfa301.png
2013-11-09 11:54:58.312347500 data/icon/3adefa587a472c98ba52103b60b6f3b83c62982bb2d4d3d01f49afcb3ecb6b9d.png
2013-11-09 11:54:58.312463500 data/icon/3b21ca8e8f4cb42692a9d8261b6dc383463b4b561394f1dc2966d18ac8ad47d0.png
2013-11-09 11:54:58.312576500 data/icon/40967f964cdce3e6ac9b5658e16a79d9783fb5dbba36eb0f3c622edb00f4ae82.png
2013-11-09 11:54:58.312603500 data/icon/59b6b8ad38a9daefc8603c121af316295113ab1a624040c0bcfb7a90b3996f34.png
2013-11-09 11:54:58.312706500 data/icon/69496e1e0ec167f814c57ef8eea53771a502445b794edacb57febb7e01966828.png
2013-11-09 11:54:58.312814500 data/icon/8d6a046eecc3980135c166793363af9547967e78aba84d31ede0d6f3544efb91.png
2013-11-09 11:54:58.312844500 data/icon/b7430e7cb8967b1c0568c62b5a7dc417b51dbf55ca347ddcf74e7310c0426cdd.png
$ carton install
Installing modules using /private/tmp/im/cpanfile
Successfully installed Imager-0.97
Successfully installed Imager-File-PNG-0.89
Imager::File::JPEG is up to date. (0.88)
2 distributions installed
Complete! Modules were installed into /private/tmp/im/local
# carton snapshot format: version 1.0
DISTRIBUTIONS
Imager-0.97
pathname: T/TO/TONYC/Imager-0.97.tar.gz
provides:
Imager 0.97
Imager::Color 1.011
Imager::Color::Float 1.005
Imager::Color::Table 1.003
Imager::CountColor 0.02
@yappo
yappo / dan.pl
Created September 12, 2013 12:30
use strict;
use warnings;
use Path::Tiny;
use File::RotateLogs;
my $log = File::RotateLogs->new(
logfile => path('/tmp')->child('access_log.%Y%m%d%H%M'),
linkname => path('/tmp')->child('access_log')
);