Skip to content

Instantly share code, notes, and snippets.

@j-mcnally
j-mcnally / leave.ex
Created October 14, 2014 03:22
leave.ex
stream_ids = for c <- socket.channels do
{_, topic} = c
stream = Struct.Services.StreamFind.call(id: topic)
Struct.Services.ViewerLeave.call(stream: stream)
end
.container.auction-authentication
.row
.col-xs-8.col-xs-offset-2
.row.row-auth: h3 Login to Your Account
form submit="authenticate"
.row.row-auth
upstream app {
server 127.0.0.1:4000 fail_timeout=5s;
}
server {
listen 80 default_server;
server_name _;
root '/var/app/current/priv/static';
** (exit) exited in: :gen_server.call(#PID<0.181.0>, {:query, "CREATE TABLE IF NOT EXISTS schema_migrations (id serial primary key, version bigint)", [], [timeout: 5000]}, 5000)
** (EXIT) exited in: :gen_server.call(#PID<0.186.0>, {:connect, [port: 5432, encoder: #Function<17.12881986/3 in Ecto.Adapters.Postgres.prepare_start/2>, decoder: #Function<16.12881986/4 in Ecto.Adapters.Postgres.prepare_start/2>, formatter: #Function<15.12881986/1 in Ecto.Adapters.Postgres.prepare_start/2>, username: "webapp", hostname: "localhost", database: "struct"]}, :infinity)
** (EXIT) an exception was raised:
** (ArgumentError) argument error
:erlang.iolist_to_binary([nil, "webapp"])
(crypto) crypto.erl:223: :crypto.hash/2
(postgrex) lib/postgrex/connection.ex:519: Postgrex.Connection.message/3
(postgrex) lib/postgrex/connection.ex:491: Postgrex.Connection.new_data/2
(postgrex) lib/postgrex/connection.ex:401: Postgrex.Connec
stream = %{stream | started_at: Ecto.DateTime.utc, ended_at: nil}
Repo.update(stream)
23:26:13.992 [error] GenServer #PID<0.235.0> terminating
Last message: {:query, "INSERT INTO \"channels\" (\"description\", \"github_id\", \"image\", \"popularity\", \"project_url\", \"title\")\nVALUES ($1, $2, $3, $4, $5, $6)\nRETURNING \"created_at\", \"id\"", ["Ruby on Rails", 8514, "https://avatars.githubusercontent.com/u/4223?v=2", 0.0, "https://github.com/rails/rails", "rails"], [timeout: 5000]}
State: %{conn: nil, monitor: nil, params: [port: 5432, encoder: #Function<17.115824485/3 in Ecto.Adapters.Postgres.prepare_start/2>, decoder: #Function<16.115824485/4 in Ecto.Adapters.Postgres.prepare_start/2>, formatter: #Function<15.115824485/1 in Ecto.Adapters.Postgres.prepare_start/2>, username: "postgres", password: "postgres", hostname: "localhost", database: "struct"]}
** (exit) exited in: :gen_server.call(#PID<0.410.0>, {:query, "INSERT INTO \"channels\" (\"description\", \"github_id\", \"image\", \"popularity\", \"project_url\", \"title\")\nVALUES ($1, $2, $3, $4, $5, $6)\nRETURNING \"created_at\", \"id
defmodule Struct.Oauth.GithubController do
import Ecto.Query, only: [from: 2]
use Phoenix.Controller
alias Struct.Router
def github(conn, _params) do
redirect conn, OAuth2Ex.Provider.Github.authorize_url
end
def github_code(conn, %{"code" => code}) do
token = OAuth2Ex.Provider.Github.get_token(code)
`import autocompleteTemplate from 'ic-autocomplete/templates/autocomplete'`;
`import autocompleteCss from 'ic-autocomplete/templates/autocomplete-css'`;
`import AutocompleteComponent from 'ic-autocomplete/autocomplete'`;
`import AutocompleteOptionComponent from 'ic-autocomplete/autocomplete-option'`;
`import AutocompleteToggleComponent from 'ic-autocomplete/autocomplete-toggle'`;
`import AutocompleteInputComponent from 'ic-autocomplete/autocomplete-input'`;
`import AutocompleteListComponent from 'ic-autocomplete/autocomplete-list'`;
IcAutocomplete =
name: 'ic-autocomplete',
defmodule RObj do
require Record
use Riak.Object
Record.defrecord :riakobj, [bucket: nil, key: nil, data: nil, metadata: nil, vclock: nil, content_type: "application/json"]
def from_robj(robj) do
riakobj(
bucket: :riakc_obj.bucket(robj),
defmodule Struct.SessionController do
use Phoenix.Controller
alias Struct.Router
def logout(conn, _params) do
delete_session(conn, :github_token)
redirect conn, Router.pages_path(:index)
end
end