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
QUEEN: | |
Good my lord, be not angry with the streets, | |
And then remove the breath of mine, yet I know no less. | |
KING EDWARD IV: | |
What means the cause why must I call thee fare? | |
Where is the prince your son, I pray you, sir, how shall the old man of my son, | |
And leave the blood of English shames the crown, | |
Which then betimes abroad shall be thy grief, | |
That thou hast the devil through the court, they will tell you both |
This file has been truncated, but you can view the full file.
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 Absinthe.Mixfile do | |
use Mix.Project | |
@version "1.5.0-dev" | |
def project do | |
[ | |
app: :absinthe, | |
version: @version, | |
elixir: "~> 1.4", |
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 Phoenix do | |
use Application | |
def start(_type, _args) do | |
_ = Phoenix.Template.engines() | |
_ = Phoenix.Template.format_encoder("index.html") | |
warn_on_missing_json_library() | |
if stacktrace_depth = Application.get_env(:phoenix, :stacktrace_depth) do | |
:erlang.system_flag(:backtrace_depth, stacktrace_depth) |
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 fuckdocker() { | |
make stop | |
docker kill `docker ps -a -q` | |
docker rm `docker ps -a -q` | |
docker rmi -f `docker images -q` | |
docker volume rm -f `docker volume ls -q` | |
docker network rm -f `docker network ls -q` | |
docker service rm `docker service ls -q` | |
} |
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 DynaQuery.EasyTest do | |
use ExUnit.Case, async: true | |
require Ecto.Query | |
alias Ecto.Query, as: Q | |
alias Haas.HomeAssessment | |
alias Haas.HomeAssessmentSponsor | |
alias Haas.HomePaint | |
alias DynaQuery.Easy | |
alias DynaQuery.Easy.Table |
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
test "query with multiple WHEREs" do | |
query = | |
Easy.from({HomeAssessment, :ha}) | |
|> Easy.where({:>=, [ha: :id], 1}) | |
|> Easy.where({:<=, [ha: :id], 10}) | |
|> Easy.build_query | |
assert inspect(query) == inspect(Q.from(ha in HomeAssessment, where: ha.id >= 1, where: ha.id <= 10)) | |
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
defmodule MyApp.JoinTest do | |
def add_join(query, qual, join_schema, join_key, _other_schema, other_key) do | |
# -------------------------->| |<-------------------------- # | |
Ecto.Query.join(query, qual, [t0], t1 in ^(join_schema), field(t1, ^join_key) == field(t0, ^other_key)) | |
# -------------------------->| |<-------------------------- # | |
end | |
test "add_join" do | |
query = | |
Ecto.Query.from(Cart) |
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
record = Enum.reduce(Map.keys(record), %{}, fn (key, map) -> | |
value = Map.get(record, key) | |
key_to_add = cond do | |
is_map(value) && Map.get(value, :__struct__, nil) == Elixir.Ecto.Association.NotLoaded -> | |
nil | |
key == :__meta__ -> | |
nil | |
key == :__struct__ -> | |
nil |
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
# Flexible argument parsing | |
# | |
# Example: | |
# Command: | |
# ``` | |
# ./docker/script --env=APP_ENV=development -v $(pwd)/foo:/foo docker.househappy.org/datafeed ./bin/run "puts 'hello'" | |
# ``` | |
# | |
# Script: | |
# ``` |
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
# ./script --env=RAILS_ENV=production --rm -- bundle exec rails c | |
# DOCKER_ARGS: | |
# --env=RAILS_ENV=production | |
# --rm | |
# PROCESS_CMD: bundle exec rails c | |
function process_container_args { | |
DOCKER_ARGS=() | |
PROCESS_CMD=() | |
_state=DOCKER_ARGS |