Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ytnobody's full-sized avatar
♨️
470

ytnobody / satoshi azuma ytnobody

♨️
470
View GitHub Profile
* 最初のプロセスはinitです!!!
* rackを例に。
* exit if fork
* ppid=1に。
* Process.setsidはプロセスを「新しいセッションのセッションリーダーにし」、「新しいプロセスグループのグループリーダーにし」、「制御端末を外す」作業をする
* プロセスは何らかのプロセスグループに属す
* Process.setpgrp(新しいgroup_id)で任意のプロセスをグループ化できる

Perlおじさんが雑にgoを触ってみた

まだちょっとしか触ってないけど、perlと比較してみて、大まかに似てるところがあるな~と思った。

goを触る上で参考にした物

@ytnobody
ytnobody / docdami.go
Last active August 29, 2015 14:06
etude for golang
package docdami
import (
"io/ioutil"
"log"
"fmt"
"github.com/lestrrat/go-xslate"
)
type Docdami struct {
@ytnobody
ytnobody / ref_and_undef.pl
Created September 1, 2014 02:45
answer for "ref ... and ... っていうのは何がしたい?"
use strict;
use warnings;
use Data::Dumper;
### case of scalar
{
my $data = 123;
ref $data and $data = undef;
print Dumper({'SCALAR' => $data});
};
@ytnobody
ytnobody / instantiate.pl
Last active August 29, 2015 14:05
benchmark for instantiate that using / not using class generators
use strict;
use Benchmark qw/:all/;
use Data::Dumper;
### Mouse
{
package
MyClass::Mouse;
use Mouse;
@ytnobody
ytnobody / sushi-qrcode.pl
Last active August 29, 2015 14:03
mishima.pm #1 向けの仕込み
#!/usr/bin/env perl
use strict;
use warnings;
use Furl;
use File::Temp 'tempdir';
use File::Spec;
use File::Slurp;
use Vector::QRCode::IntoPDF;
ytnobody@ytnobody-virtual-machine:~/vznope-bash$ cat centos-mysql
create centos@6
set --nameserver 8.8.8.8
start
exec yum -y update
exec yum -y install mysql-server
ytnobody@ytnobody-virtual-machine:~/vznope-bash$ vzn build 102 < centos-mysql
---
RUN: create centos@6
@ytnobody
ytnobody / sqlmaker.pl
Last active August 29, 2015 14:03
an example for using SQL::Maker
use strict;
use warnings;
use SQL::Maker;
my $maker = SQL::Maker->new(driver => 'mysql');
my ($sql, @binds) = $maker->select(
'book',
['*'],
{price => {'<=' => 1000}},

PostScript::Simple is so useful module. But, it makes confused when using with Carton.

Solution, add a line-feed to head of package name of each t/lib/Test/*.pm .

  • as is
package Test::More;
use strict;
use Plack::Builder;
use Data::Dumper;
my $app = sub {
[404, [], ['Not Found']];
};
my $psgi = builder {
enable "Debug";