A simple Ecto custom type for the Postgres tsrange type.
Based on: http://pedroassumpcao.ghost.io/using-postgres-range-data-type-in-ecto/ and elixir-ecto/postgrex#27
| class CreateEmailTest | |
| include Lotus::Interactor | |
| def initialize(params) | |
| @params = params | |
| @email_test = EmailTest.new(@params[:email_test]) | |
| end | |
| def call | |
| Operation.new(self, email_test: @email_test). |
| require "virtus" | |
| module Commands | |
| module Base | |
| def self.included(base) | |
| base.extend ClassMethods | |
| base.include Virtus.model | |
| base.include ActiveModel::Validations | |
| base.prepend InstanceMethods |
| package main | |
| import ( | |
| "bytes" | |
| "exec" | |
| "log" | |
| "os" | |
| ) | |
| // Pipeline strings together the given exec.Cmd commands in a similar fashion |
| defmodule SecureRandom do | |
| @moduledoc """ | |
| Ruby-like SecureRandom module. | |
| ## Examples | |
| iex> SecureRandom.base64 | |
| "xhTcitKZI8YiLGzUNLD+HQ==" | |
| iex> SecureRandom.urlsafe_base64(4) |
A simple Ecto custom type for the Postgres tsrange type.
Based on: http://pedroassumpcao.ghost.io/using-postgres-range-data-type-in-ecto/ and elixir-ecto/postgrex#27
This guide was written because I don't particularly enjoy deploying Phoenix (or Elixir for that matter) applications. It's not easy. Primarily, I don't have a lot of money to spend on a nice, fancy VPS so compiling my Phoenix apps on my VPS often isn't an option. For that, we have Distillery releases. However, that requires me to either have a separate server for staging to use as a build server, or to keep a particular version of Erlang installed on my VPS, neither of which sound like great options to me and they all have the possibilities of version mismatches with ERTS. In addition to all this, theres a whole lot of configuration which needs to be done to setup a Phoenix app for deployment, and it's hard to remember.
For that reason, I wanted to use Docker so that all of my deployments would be automated and reproducable. In addition, Docker would allow me to have reproducable builds for my releases. I could build my releases on any machine that I wanted in a contai
In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.
At the moment GraphQL allows 2 types of queries:
querymutationReference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.