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
| # Had some issues, so referenced these 3 solutions: | |
| # https://gist.github.com/cjolly/2870054 | |
| # https://gist.github.com/cloud8421/6667898 | |
| # http://stackoverflow.com/questions/20754669/how-to-fix-postgres-after-updating-upgrading-brew | |
| launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
| pg_dumpall > ninedottwo-dump | |
| # Not sure if this is necessary, but has to be cleared out no matter what for when we run initdb |
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
| before_script: | |
| - ./script/travis/setup_db.sh | |
| script: bundle exec rspec spec/ --tag $TEST_TAG | |
| env: | |
| matrix: | |
| - TEST_TAG=js DB_TEST=1 | |
| - TEST_TAG=~js DB_TEST=2 |
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
| Enum.each 1..100, fn (n) -> | |
| fizzbuzz = fn | |
| (0, 0, _) -> "fizzbuzz" | |
| (0, _, _) -> "fizz" | |
| (_, 0, _) -> "buzz" | |
| (_, _, n) -> n | |
| end | |
| IO.puts fizzbuzz.(rem(n, 3), rem(n, 5), n) | |
| end |
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 WeatherParser do | |
| require Record | |
| Record.defrecord :xmlElement, Record.extract(:xmlElement, from_lib: "xmerl/include/xmerl.hrl") | |
| Record.defrecord :xmlText, Record.extract(:xmlText, from_lib: "xmerl/include/xmerl.hrl") | |
| def parse(xml, attrs) do | |
| xml | |
| |> :binary.bin_to_list | |
| |> :xmerl_scan.string | |
| |> extract_values(attrs, []) |
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 DBTransactions do | |
| use ExUnit.CaseTemplate | |
| setup_all do | |
| Ecto.Adapters.SQL.begin_test_transaction(Repo) | |
| on_exit fn -> | |
| Ecto.Adapters.SQL.rollback_test_transaction(Repo) | |
| end | |
| end |
OlderNewer