Skip to content

Instantly share code, notes, and snippets.

View yyamano's full-sized avatar

Yuji Yamano yyamano

View GitHub Profile
@yyamano
yyamano / .kitchen.yml-patch
Last active December 28, 2015 09:19
vagrant-cachier (https://github.com/fgrehm/vagrant-cachier) support patch for kitchen-vagrant-0.11.3. This is just for temporary local hack, because Seth, the author of kitchen-vagrant want more generic implementation to support flexible configuration. See https://github.com/test-kitchen/kitchen-vagrant/issues/51
diff --git a/.kitchen.yml b/.kitchen.yml
index 1e3fa53..8a55bf5 100644
--- a/.kitchen.yml
+++ b/.kitchen.yml
@@ -2,6 +2,8 @@
driver_plugin: vagrant
driver_config:
require_chef_omnibus: true
+ cache:
+ auto_detect: true
@yyamano
yyamano / ip
Created June 11, 2014 14:08
ip alias for non Linux platform
alias ip 'echo "You are using `uname -s`, not Linux. Use traditional arp, ifconfig, netstat or route instead." && false'
@yyamano
yyamano / gist:796f34a257cb1c685393
Last active August 29, 2015 14:16
ruby DSL example for command execution
#! /usr/pkg/bin/ruby
# Copyright (c) 2015 Yuji Yamano
# The BSD 2-Clause License.
require 'open3'
require 'date'
require 'stringio'
module DSL
class Command
@yyamano
yyamano / affirmation
Created May 21, 2015 05:37
MuleSoft Contributor Agreement Acceptance by Yuji Yamano
I, Yuji Yamano, have read and do accept the MuleSoft Contributor Agreement
at http://www.mulesoft.org/legal/contributor-agreement.html
Accepted on Thu May 21 2015 14:37:22 GMT+0900 (JST)
# Taken from embulk/lib/embulk/guess/csv.rb
def array_avg(array)
array.inject(0.0) {|r,i| r += i } / array.size
end
def array_variance(array)
avg = array_avg(array)
array.inject(0.0) {|r,i| r += (i - avg) ** 2 } / array.size
end
diff --git a/src/main/java/org/raml/parser/loader/FileResourceLoader.java b/src/main/java/org/raml/parser/loader/FileResourceLoader.java
index 5ec1e11..883b5bd 100644
--- a/src/main/java/org/raml/parser/loader/FileResourceLoader.java
+++ b/src/main/java/org/raml/parser/loader/FileResourceLoader.java
@@ -42,12 +42,15 @@ public class FileResourceLoader implements ResourceLoader
@Override
public InputStream fetchResource(String resourceName)
{
- File includedFile = new File(parentPath, resourceName);
+ File includedFile = new File(resourceName);
ngx_http_core_access_phase(ngx_http_request_t *r, ngx_http_phase_handler_t *ph) の中で、サブリクエストの場合、ハンドラをスキップしている。
if (r != r->main) {
r->phase_handler = ph->next;
return NGX_AGAIN;
}

ビルドシステムのリファクタリング

  • ビルドシステムが複雑で辛いのでなんとかしたい
    • mrubyとnginxはそれぞれ独自のビルドシステムを持っており、ngx_mrubyはそれをつなぐモジュールなので仕方ないけど…
    • まだよくわかってないことが多い
  • build.sh と test.shのコードが重複
  • 環境変数と引数指定の混在をどうにかしたい
  • ダイナミックモジュールとスタティックモジュールのビルドの整理。
    • configure後は切り替えれないが、Makefileの中には切り替えているコードもある
  • 再ビルド、生成したファイルの削除などが思ったようにいかないことがある。未調査。
;; http://yanok.net/2010/07/mew34utf-8.html
(defun use-utf-8-for-jisx0213(ecsdb)
(let ((cs (nth 0 ecsdb))
(enc (nth 1 ecsdb)))
(if (equal enc (intern "iso-2022-jp-3"))
(list (nth 0 ecsdb) 'utf-8 mew-charset-utf-8-encoding mew-charset-utf-8-header-encoding t)
ecsdb)))
(setq mew-cs-database-for-encoding (mapcar 'use-utf-8-for-jisx0213 mew-cs-database-for-encoding))
(add-to-list 'mew-field-spec '("^\\(ARC-Seal\\|ARC-Message-Signature\\|ARC-Authentication-Results\\):$" nil))