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
build_package_patch_ruby_railsexpress() { | |
fetch_git rvm-patchsets git://github.com/skaes/rvm-patchsets.git master | |
for p in rvm-patchsets/patches/ruby/1.9.3/p194/railsexpress/* ; do | |
patch -p1 < $p | |
done | |
} | |
install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz" | |
install_package "ruby-1.9.3-p194" "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz" patch_ruby_railsexpress autoconf standard |
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
# .irbrc | |
if defined?(Rails) && Rails.production? | |
conf = IRB.conf[:PROMPT][IRB.conf[:PROMPT_MODE]] | |
red = "\033[0;31m" | |
reset = "\033[0m" | |
[:PROMPT_S, :PROMPT_C].each do |p| | |
conf[p].gsub!(/^(.*)$/, "#{red}\\1#{reset}") | |
end | |
conf[:PROMPT_I] = "#{red}%N(%m):%03n:%i (PRODUCTION) > #{reset}" | |
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
# Save file as 1.9.3-p327-railsexpress and copy to ruby-build definitions directory. | |
# If you've installed ruby-build with brew this will be /usr/local/share/ruby-build/ | |
build_package_patch_ruby_railsexpress() { | |
fetch_git rvm-patchsets git://github.com/skaes/rvm-patchsets.git master | |
for p in rvm-patchsets/patches/ruby/1.9.3/p327/railsexpress/* ; do | |
patch -p1 < $p | |
done | |
} |
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
# Save file as 1.9.3-p374-railsexpress and copy to ruby-build definitions directory. | |
# If you've installed ruby-build with brew this will be /usr/local/share/ruby-build/ | |
build_package_patch_ruby_railsexpress() { | |
fetch_git rvm-patchsets git://github.com/skaes/rvm-patchsets.git master | |
for p in rvm-patchsets/patches/ruby/1.9.3/p374/railsexpress/* ; do | |
patch -p1 < $p | |
done | |
} |
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
build_package_patch_ruby_railsexpress() { | |
fetch_git rvm-patchsets git://github.com/skaes/rvm-patchsets.git master | |
for p in rvm-patchsets/patches/ruby/1.9.3/p392/railsexpress/* ; do | |
patch -p1 < $p | |
done | |
} | |
install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz" | |
install_package "ruby-1.9.3-p392" "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz" patch_ruby_railsexpress autoconf standard |
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
build_package_patch_ruby_railsexpress() { | |
fetch_git rvm-patchsets git://github.com/skaes/rvm-patchsets.git master | |
for p in rvm-patchsets/patches/ruby/1.9.3/p448/railsexpress/* ; do | |
patch -p1 < $p | |
done | |
} | |
install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz#36c852831d02cf90508c29852361d01b" | |
install_package "ruby-1.9.3-p448" "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p448.tar.gz#a893cff26bcf351b8975ebf2a63b1023" patch_ruby_railsexpress autoconf standard |
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
iex(1)> stream = File.stream!("does_not_exist") | |
%File.Stream{line_or_bytes: :line, modes: [:raw, :read_ahead, :binary], | |
path: "does_not_exist", raw: true} | |
iex(2)> stream |> Enum.take(1) | |
** (File.Error) could not stream "does_not_exist": no such file or directory | |
(elixir) lib/file/stream.ex:78: anonymous fn/2 in Enumerable.File.Stream.reduce/3 | |
(elixir) lib/stream.ex:1121: anonymous fn/5 in Stream.resource/3 | |
(elixir) lib/enum.ex:2161: Enum.take/2 |
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
iex(10)> m = %{a: 1} | |
%{a: 1} | |
iex(11)> %{a: 1} = %{a: 1, b: 2} | |
%{a: 1, b: 2} | |
iex(12)> ^m = %{a: 1, b: 2} | |
** (MatchError) no match of right hand side value: %{a: 1, b: 2} |
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
defmodule ChainedStream do | |
# [#Function<59.77324385/2 in Stream.unfold/2>, #Function<59.77324385/2 in Stream.unfold/2>] | |
def test do | |
states = count(%{}, ["a", "b", "c"]) |> Enum.to_list | |
# [{%{"a" => 1}, ["b", "c"]}, {%{"a" => 1, "b" => 1}, | |
# ["c"]}, {%{"a" => 1, "b" => 1, "c" => 1}, []}] | |
states |> Enum.at(-1) |> elem(0) |> count(["a", "b", "d"]) | |
# [{%{"a" => 2, "b" => 1, "c" => 1}, ["b", "d"]}, | |
# {%{"a" => 2, "b" => 2, "c" => 1}, ["d"]}, |