This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function abspath() { | |
if [[ ! -r "${1}" ]]; then | |
echo >&2 "No such file or directory: $1" | |
return 1 | |
fi | |
if [[ -d "${1}" ]]; then | |
echo "$(cd "${1}" || return 1; pwd)" | |
else | |
echo "$(cd "$(dirname "${1}")" || return 1; pwd)/$(basename "${1}")" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EXCLUDE_PATTERNS := Makefile | |
SOURCES := $(filter-out $(EXCLUDE_PATTERNS), $(shell git ls-files)) | |
TARGETS := $(addprefix $(HOME)/, $(SOURCES)) | |
$(TARGETS): $(HOME)/% : $(PWD)/% | |
@cp $< $@ | |
all: $(TARGETS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
N = 3 | |
Vagrant.configure(2) do |config| | |
(1..N).each do |node_id| | |
config.vm.define "node-#{node_id}" | |
end | |
# Triggerを使って最後のVMをセットアップする時だけAnsible Provisionを有効にする。 | |
config.trigger.before :up do |trigger| | |
node_id = 1 | |
trigger.ruby do |env, machine| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type result = .. | |
type result += | |
| IntVal of int | |
type expr = .. | |
type expr += | |
| Int of int | |
| Add of expr * expr | |
| Sub of expr * expr | |
exception Extension of expr * (result -> result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type result = .. | |
type result += | |
| IntVal of int | |
type expr = .. | |
type expr += | |
| Int of int | |
| Add of expr * expr | |
| Sub of expr * expr | |
exception Extension of expr * (result -> result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type 'a expr = .. | |
type 'a expr += | |
| Int: int -> int expr | |
| Add: int expr * int expr -> int expr | |
| Sub: int expr * int expr -> int expr | |
effect Extension: 'a expr -> 'a | |
let rec eval1: type a. a expr -> a = function | |
| Int n0 -> n0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
int main(int argc, char **argv) { | |
int fd1 = open("./services", O_RDONLY); | |
int fd2 = open("./services", O_RDONLY); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module type EQ_CODE = sig | |
type t | |
val eq: (t -> t -> bool) code | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MakeSet (Eq: EQ) = struct | |
type elt | |
type set | |
let member : (elt -> set -> bool) code | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
実行環境: Mac OSX 10.11.16, コンパイラ・バージョン: 4.04 | |
linerlock:example linerlock$ ocamlfind ocamlc -ppx ../src/ppx_test -c example.ml | |
File "/var/folders/x_/r9b6vjld0d77n2cnzm0zqmph0000gn/T/camlppx8c76a8", line 1: | |
Error: I can't decide whether /var/folders/x_/r9b6vjld0d77n2cnzm0zqmph0000gn/T/camlppx8c76a8 is an implementation or interface file | |
File "example.ml", line 1: | |
Error: Error while running external preprocessor | |
Command line: ../src/ppx_pf '/var/folders/x_/r9b6vjld0d77n2cnzm0zqmph0000gn/T/camlppx8c76a8' '/var/folders/x_/r9b6vjld0d77n2cnzm0zqmph0000gn/T/camlppx0495de' |
NewerOlder