Skip to content

Instantly share code, notes, and snippets.

View JEEN's full-sized avatar

Jeen Lee JEEN

View GitHub Profile
@JEEN
JEEN / d3.html
Created April 21, 2016 04:22
d3.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.node {
stroke: #fff;
stroke-width: 1.5px;
}
.link {
@JEEN
JEEN / sum.pl
Last active April 14, 2016 15:23
sum.pl
use strict;
use warnings;
use Text::CSV_XS;
use Path::Class::Rule;
use Data::Printer;
use Tie::IxHash;
die "Usage: perl sum.pl [directory]" unless -d $ARGV[0];
my $csv = Text::CSV_XS->new({ binary => 1 });
my $rule = Path::Class::Rule->new;
@JEEN
JEEN / ko.pm
Created December 10, 2015 08:59
DateTime::Format::Flexible::lang::ko
package DateTime::Format::Flexible::lang::ko;
use strict;
use warnings;
use utf8;
sub new
{
my ( $class , %params ) = @_;
my $self = bless \%params , $class;
@JEEN
JEEN / article.markdown
Last active August 29, 2015 14:11
Boolean for Perl/JSON/etc

Boolean for Perl/JSON

펄로 몇 가지 제품을 개발하는 중 __다른 언어/환경과 데이터를 주고받고 하는 와중__에 회사 동료로부터

펄은 Boolean 표기가 없냐? 왜 데이터가 전부 0 아니면 1이야? C냐?

라는 이야기를 들었습니다.

그러고보면 그냥 익숙하게 true1, false0으로 사용하고 있었습니다.

@JEEN
JEEN / vs.pl
Last active August 29, 2015 14:08
Time::Moment-Inherited vs DateTime
package Time::Moment::Lite;
use parent 'Time::Moment';
sub last_day_of_month {
shift->with_day_of_month(1)->minus_days(1);
}
sub as_str {
shift->strftime('%Y-%m-%d %H:%M:%S');
}
@JEEN
JEEN / pick_something.pl
Created September 29, 2014 08:38
Pick Something
use strict;
use warnings;
use Lingua::Sentence;
use Data::Printer;
open my $fh, "<", $ARGV[0] or die "OH FILE!!";
my $body = do { local $/; <$fh> };
my $keyword = $ARGV[1];
die "OH KEYWORD" unless $keyword;
@JEEN
JEEN / pick_amount_sentence.pl
Last active August 29, 2015 13:58
pick_amount_sentence.pl
use strict;
use warnings;
no warnings 'recursion';
use LWP::Simple;
use Web::Query::LibXML;
use Encode ();
BEGIN {
binmode STDOUT, ":utf8";
};
use strict;
use warnings;
no warnings 'recursion';
use LWP::Simple;
use Data::Dumper;
use Web::Query::LibXML;
my $text = LWP::Simple::get('http://www.sec.gov/Archives/edgar/data/790730/000079073009000004/0000790730-09-000004.txt');
my ($html) = $text =~ /(<html>.+<\/html>)/gms;

MojoX::JSON::XS

sub startup {
    ....
    $self->plugin('MojoX::JSON::XS');
}

Test::Mojo 와 함께 하는 보다 쉽고 편한 Web Application 테스트

저자

@JEEN_LEE - 좋은 아빠 워너비

시작하며

어떻게 하면 테스트 코드를 잘 쓸 수 있을까 하는 고민은 업계에 들어오고, 엉망진창인 테스트코드를 쓰면서도 계속되는 것이었습니다. 그렇다면 "잘 쓴 테스트 코드"는 어떤 것이어야 하는 것일까요? 그걸 알면 제가 이걸 쓰고 있겠습니까? 결론은 좋은 테스트 도구를 만나면 이전과는 다른 "보다 좋은" 테스트를 쓸 수 있지 않을까하고 생각했습니다. 바로 Test::Mojo 를 사용하면서 말이죠. 그렇기에 이 기사에서 다룰 테스트 어플리케이션은 Mojolicious 로 만들어 졌다는 것을 전제로 합니다.