This file contains hidden or 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
//Schema bevat array met prop names | |
//eerste waarde van de value array is de naam van het schema | |
{ | |
schemas:{ | |
"a": ["name", "firstname", "address"], | |
"b": ["code", "description"] | |
}, | |
values:[ | |
["a", "Doe", "John", "meir 150"], | |
["b", "23321T5", "Te laat opgestaan"] |
This file contains hidden or 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
defmodule Maze do | |
def get_maze maze_size do | |
maze = | |
for y <- (maze_size..1), | |
do: build_row(y, maze_size) | |
end | |
defp build_row(y, maze_size), do: Enum.into(%{}, build_row_tuples(y, maze_size)) | |
defp build_row_tuples(y, maze_size)do |
This file contains hidden or 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
class Array | |
class ArrayProcWrapper | |
attr_accessor :ary | |
def to_proc | |
lambda { |obj| obj.send self.ary.first, *self.ary[1..-1]} | |
end | |
end | |
def to_proc_wrapper |
This file contains hidden or 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 Celluloid | |
class Thread < ::Thread | |
def []= key, value | |
if key_on_thread? key | |
thread_vars[key] = value | |
else | |
super | |
end | |
end |