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
Show hidden characters
// See the updated gist at https://gist.github.com/hickscorp/08b0c945e7d3a5879a6b7924c6a44628 | |
// Make sure you install the ANSIEscape package if you want color support. | |
// | |
// Just drop this file in your elixir project root folder, and rename it to | |
// match it, eg `whatever.sublime-project`. | |
// Then open sublime like so: `subl whatever.sublime-project` | |
// The build command will become available by pressing `Ctrl+Shift+B`. | |
// | |
// It's also recommended to install those two packages: | |
// - Elixir for syntax coloring: https://packagecontrol.io/packages/Elixir |
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 GraphqlHelpers do | |
import Ecto.Query | |
@doc """ | |
## example | |
field :storages, list_of(:storage), do: has_many(:storages) | |
""" | |
defmacro has_many(model) do | |
quote do | |
resolve fn subject, _, _ -> |
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 Tcprpc.Server do | |
use GenServer.Behaviour | |
defrecord State, port: nil, lsock: nil, request_count: 0 | |
def start_link(port) do | |
:gen_server.start_link({ :local, :tcprcp }, __MODULE__, port, []) | |
end | |
def start_link() do |