Skip to content

Instantly share code, notes, and snippets.

perl -le'print$~^" !#64:"'
@sugyan
sugyan / gist:181474
Created September 5, 2009 18:34
スクリプト記号化スクリプト
#!/usr/bin/perl
use strict;
use warnings;
# 変換辞書
my $dict = do {
my $dict = {};
# 使用する9種類の記号と改行コード(これらにシングルクォートが加わる)
my @chars = (qw/ ^ . ( ) ~ ? ! { } /, "\x0A");
@sugyan
sugyan / gist:181613
Created September 6, 2009 02:32
記号化スクリプトを記号化したもの
''!~('(?{'.('?~~
{{{!
!)!~~~!)~!{?^{{{!~({
~?!
.~^.^{^?^?~.{^{~(~(~{()?(
?}}^}^{{{
(.()}{^!!~)..?)^!((){!{
..(~}.({~~.(
!^.{!!{!)^}~?)}^.(}..^~~){!.({
~.~~{
@sugyan
sugyan / gist:188902
Created September 18, 2009 05:45
引数で渡したテキストの10行目から20行目だけを表示するワンライナー
perl -e'""!~("(?{".("?.){~{)}!~}(.}!~( ~(^!({.~???}(!~..!!"^") (!(??{{?{) (}{.~!)(.~.}!!)}~!~.{}.{"^"}}~?{! ). ~?..!}) }()){ ~ (}({?){."^".{?)!}})} ??~ )})!..)}?!~()!)).??({^("^" ~! .){! })!!?{) ??{~~!}!? {.^~))~? ~")."})")' hoge.txt
@sugyan
sugyan / gist:198973
Created October 1, 2009 14:05
AnyEventを使った簡単ターミナルTwitterクライアント
use strict;
use warnings;
use AnyEvent;
use AnyEvent::Twitter;
use Encode qw/decode_utf8 encode_utf8/;
# ユーザー名、パスワードを引数から取得
my ($username, $password) = @ARGV;
my $twitty = AnyEvent::Twitter->new(
package AnyEvent::Twitter::EnableOAuth;
use strict;
use warnings;
use base qw/Object::Event/;
use AnyEvent::HTTP;
use Carp 'croak';
use Encode 'encode_utf8';
use Digest::SHA;
use strict;
use warnings;
use Encode 'decode_utf8';
use Net::Twitter::Lite;
my $nt = Net::Twitter::Lite->new(
consumer_key => 'http://twitter.com/oauth_clients で登録したもの',
consumer_secret => 'http://twitter.com/oauth_clients で登録したもの',
);
@sugyan
sugyan / gist:218050
Created October 25, 2009 12:55
AnyEvent::Wassr example
use strict;
use warnings;
use AnyEvent;
use AnyEvent::Wassr;
use Encode 'encode_utf8';
my $wassr = AnyEvent::Wassr->new(
username => '<your user id>',
password => '<password>',
#!/usr/bin/perl
use strict;
use warnings;
use AnyEvent;
use AnyEvent::Twitter;
use Net::Twitter;
my %config = (
username => 'twitter username',
#!/opt/local/bin/perl
use strict;
use warnings;
use Config::Pit;
use Date::Parse 'str2time';
use Net::Twitter;
my $nt = Net::Twitter->new(%{pit_get(
"twitter.com",