Skip to content

Instantly share code, notes, and snippets.

View lestrrat's full-sized avatar

lestrrat lestrrat

View GitHub Profile
@lestrrat
lestrrat / gist:b7dc1b85a0464fe1020e
Last active August 29, 2015 14:05
Ideas for build-anything installer

RFC: Omnidep

Install mode

  • Fetch from git repository
  • Satisfy deps by reading tbd.json (git repo + SHA1/commit-ish) and recursively run install
  • Run hooks (e.g. perl Makefile.PL)
  • Optionally, run tests

Packaging mode

Tips On How To Look Good In A YAPC::Asia Photo

ref http://yapcasia.org/2014/photos

  • PCばかり見るのはやめましょう。
  • 画面ばかり見上げるのはやめましょう。
  • 良い笑顔を見せましょう。
  • 身振り手振りを時折入れましょう
  • もし視界にカメラマンの人が見えたら、あちこち歩き回るのは一瞬やめてバックパネルの前に陣取りましょう
  • もし視界にカメラマンの人が見えたら、そちらの方向に体を向けてあげましょう
ADDR=$(docker inspect $CONTAINER_NAME | perl -ne '/"IPAddress": "([^"]+)"/ && print "$1\n"')
echo "host-record=$CONTAINER_NAME,$ADDR" > /etc/dnsmasq.d/docker-$CONTAINER_NAME
service dnsmasq restart
# At this point I'm just inching towards sending a request to the upstream.
# So first goal is to make http1client_connect() to succeed...
# Instead I get this.
# I wonder why chunked.on_setup_ostream is being called twice, thus (I believe
# is causing the assert to fail)
# Note: upstream server is NOT running, so I'm expecting a failure to connect.
shoebill% ./h2o
Creating filter of size 40
inserted new filter at 1
@lestrrat
lestrrat / gist:5180bebeeafb1fd6394d
Created December 15, 2014 02:58
Convert .conf style config to .pl
perl -MData::Dumper -MConfig::General -E ‘$Data::Dumper::Indent = $Data::Dumper::Terse = $Data::Dumper::Sortkeys = 1; say Dumper(Config::General->new(“filename”)->config)
print "Hello, $ARGV[0]\n"
#!perl
use strict;
print <<EOM;
Hello, World!
EOM
exit 0;
@lestrrat
lestrrat / architecture.md
Created March 4, 2015 00:29
Ideas on new peco architecture

NEW peco architecture

Pipeline

  1. InputReader - Reads from os.Stdin or file
  2. RawListBuffer - Buffers output from InputReader
  3. QueryFilter - Receive stream of Line objects, and filters according to user query
  4. FilteredLineBuffer - Buffers output from QueryFilter
  5. PagedLineBuffer - Type of FilteredLineBuffer, but creates a "paged" view of the filtered buffer, so it can be displayed to the terminal
@lestrrat
lestrrat / gist:281b5ecc69d3b3b9f12b
Created March 4, 2015 01:35
とうとう脳内デバッグだけ追えるgoroutineの並列度を突破したのでトレース用のPrintfをあちこちに仕込むことにした
package peco
import (
"log"
"os"
)
type traceLogger interface {
Printf(string, ...interface{})
}
diff --git a/lib/MojoMojo/Schema/Result/Page.pm b/lib/MojoMojo/Schema/Result/Page.pm
index 102844e..2bc94db 100644
--- a/lib/MojoMojo/Schema/Result/Page.pm
+++ b/lib/MojoMojo/Schema/Result/Page.pm
@@ -6,7 +6,7 @@ use Carp qw/croak/;
use base qw/MojoMojo::Schema::Base::Result/;
-__PACKAGE__->load_components( "PK::Auto", "Core" );
+__PACKAGE__->load_components( "PK::Auto", "UTF8Columns", "Core");