Wednesday, March 18, 2009

Apache Tip: AddType

see I setup a http://code.fayland.org/ for code review. then I want to show plain text for pl file like Makefile.PL
but by default, it's handled by perl. and it shows a 500 error in browser.

with the dreamhost support, I create a .htaccess like

RemoveHandler .pl .PL .t .html
AddType text/plain .pl .PL .t .html

and it works!

Thanks.

Labels:

Friday, March 13, 2009

GitStore

I just released another module http://search.cpan.org/dist/GitStore/ this morning.

GitStore - Git as versioned data store in Perl
use GitStore;

my $gs = GitStore->new('/path/to/repo');
$gs->store( 'users/obj.txt', $obj );
$gs->store( ['config', 'wiki.txt'], { hash_ref => 1 } );
$gs->commit();
$gs->store( 'yyy/xxx.log', 'Log me' );
$gs->discard();

# later or in another pl
my $val = $gs->get( 'user/obj.txt' ); # $val is the same as $obj
my $val = $gs->get( 'config/wiki.txt' ); # $val is { hashref => 1 } );
my $val = $gs->get( ['yyy', 'xxx.log' ] ); # $val is undef since discard

for now, it requires the Git::PurePerl master code. you must git clone it from http://github.com/acme/git-pureperl/tree/master and install into your local dir.

The git repo is http://github.com/fayland/perl-git-store/tree/master
welcome to fork it and submit any patches.

Thanks.

Labels: ,

Sunday, March 08, 2009

Net::GitHub

I just released the new http://search.cpan.org/dist/Net-GitHub/.

it's basically a Perl interface to github.com which is the most popular git host in the world. perl5's source and perl6's rakudo source are there too.

I'm starting to like git and I put my code there too.
be inspired by Net::Google::Code, I created the http://github.com/fayland/perl-net-github/tree/master
everyone is welcome to fork it then pull request back to me.

Thanks very much, Enjoy.

Labels: , ,

Saturday, March 07, 2009

note: github and Win32

when author is unknown, you need set
E:\Fayland\perl-net-github>git config --global user.name "fayland"
E:\Fayland\perl-net-github>git config --global user.email fayland@gmail.com

just a note.

if more than one master, you need
git config branch.master.remote origin
git config branch.master.merge refs/heads/master
from http://snippets.dzone.com/posts/show/5714

another note.

Labels: