Skip to content

Instantly share code, notes, and snippets.

View magnolia-k's full-sized avatar

Magnolia.K magnolia-k

View GitHub Profile
@magnolia-k
magnolia-k / plbld
Created August 24, 2013 04:56
simple perl build tool
#!/usr/bin/perl
use strict;
use warnings;
use autodie;
use File::Temp;
use File::Fetch;
use File::Path qw/make_path/;
#!/bin/sh
# setup shellscript for Stylistics
STYLISTICS_URL=https://github.com/magnolia-k/Stylistics/archive/master.zip
STYLISTICS_DIR=/opt/Stylistics/
# check env
if [ ! `which git` ]; then
echo "git isn't installed"
@magnolia-k
magnolia-k / Lib::Build.md
Last active August 29, 2015 13:57
Lib::Buildのアイディア整理
  • Lib::Build - Yet another shared library package manager
  • PerlベースのDSLでインストール条件を定義
  • 指定したディレクトリにまとめてインストール
  • シンボリック方式ではなく、全てまとめてインストール
  • バージョンアップ時は、全て再インストール(頻繁にライブラリのバージョンを上げるとは思えないので
  • インストール済みのソフトウェアの一覧は、インストール先のディレクトリに保存しておく。
  • 新しいバージョンがリリースされているかチェックを行う。
#!perl
use strict;
use warnings;
use IPC::Open3;
use Socket;
use IO::Handle;
use IO::Poll;
@magnolia-k
magnolia-k / gist:9f5211af7d13cd33ea49
Last active August 29, 2015 14:04
Test::More utf8 test
$ cat unicode_02.t
use strict;
use warnings;
use utf8;
use Test::More;
binmode Test::More->builder->$_, ":utf8" for qw/output failure_output todo_output/;
@magnolia-k
magnolia-k / gist:22f6cdc6456f5c83ba9b
Created August 8, 2014 09:07
non latin-1 test script name
$ cat tést.t
use strict;
use warnings;
use Test::More qw/modern/;
ok(0, "test failure" );
subtest 'subtest' => sub {
ok(0, "sub test failure" );
use strict;
use warnings;
use utf8;
use Test::More;
tap_encoding 'cp932';
ok(0, 'テスト失敗');
use strict;
use warnings;
use utf8;
use Test::More;
binmode('STDOUT', ':encoding(cp932)');
binmode('STDERR', ':encoding(cp932)');
import scala.io.Source
object perlVersions extends App {
val perlVersionList = parsePerlVersions("http://www.cpan.org/src/5.0/")
perlVersionList.foreach(println)
def parsePerlVersions(url: String): List[String] = {
val html = Source.fromURL(url).mkString
@magnolia-k
magnolia-k / gist:b556e358bfb6e5c6b3e5
Created December 31, 2014 03:03
perlの正式版のバージョンの一覧を作る
import scala.io.Source
object perlVersions extends App {
val perlVersionList = parsePerlVersions("http://www.cpan.org/src/5.0/")
perlVersionList.foreach(println)
def parsePerlVersions(url: String): List[String] = {
val html = Source.fromURL(url).mkString