Skip to content

Instantly share code, notes, and snippets.

[error] an exception was raised:
** (Phoenix.Template.UndefinedError) Could not render "invitation_request.html" for ElijahWeb.InvitationRequestView, please define a matching clause for render/2 or define a template at "lib/elijah_web/templates/invitation_request/*". The following templates were compiled:
* invitation_request_loading.html
@mazz
mazz / iex.ex
Created October 19, 2020 20:43
insert two users to the same org, second association clobbers first
iex(2)> org = Repo.get(Org, 1)
[debug] QUERY OK source="orgs" db=11.6ms decode=1.4ms queue=1.4ms idle=1333.3ms
SELECT o0."id", o0."basename", o0."shortname", o0."uuid", o0."hash_id", o0."inserted_at", o0."updated_at" FROM "orgs" AS o0 WHERE (o0."id" = $1) [1]
%Elijah.Schema.Org{
__meta__: #Ecto.Schema.Metadata<:loaded, "orgs">,
basename: "app",
channels: #Ecto.Association.NotLoaded<association :channels is not loaded>,
hash_id: "6vz6",
id: 1,
inserted_at: ~U[2020-10-19 16:27:51Z],
@mazz
mazz / search_live.ex
Last active October 5, 2020 12:10
liveview
defmodule ElijahWeb.SearchLive do
use ElijahWeb, :live_view
alias Elijah.Bank
require Logger
def mount(_params, _session, socket) do
socket =
assign(socket,
[debug] QUERY OK source="users" db=1.8ms decode=2.1ms queue=1.4ms idle=130.8ms
SELECT TRUE FROM "users" AS u0 WHERE (u0."email" = $1) LIMIT 1 ["kostas@live.com"]
#Ecto.Changeset<
action: nil,
changes: %{email: "kostas@live.com", password: "rubf6TFg"},
errors: [],
data: #Elijah.Accounts.User<>,
valid?: true
>
#Ecto.Changeset<
@mazz
mazz / simplecombine.swift
Created August 25, 2020 16:54
simple combine example
//
// ViewController.swift
// combinetest
//
// Created by Michael on 2020-08-25.
// Copyright © 2020 Michael. All rights reserved.
//
import Cocoa
import Combine
@mazz
mazz / NYXAVCEncoder.swift
Created August 13, 2020 21:49 — forked from Nyx0uf/NYXAVCEncoder.swift
Hardware accelerated GIF to MP4 converter in Swift using VideoToolbox
import VideoToolbox
import AVFoundation
private var __canHWAVC: Bool = false
private var __tokenHWAVC: dispatch_once_t = 0
public protocol NYXAVCEncoderDelegate : class
{
func didEncodeFrame(frame: CMSampleBuffer)
func didFailToEncodeFrame()
11:54:33.952 [error] GenServer #PID<0.289.0> terminating
** (Membrane.ParentError) Duplicated names in children specification: [:audio_timestamper, :audio_payloader, :audio_cmaf_muxer]
(membrane_core 0.5.2) lib/membrane/core/parent/child_life_controller/startup_handler.ex:26: Membrane.Core.Parent.ChildLifeController.StartupHandler.check_if_children_names_unique/2
(membrane_core 0.5.2) lib/membrane/core/parent/child_life_controller.ex:27: Membrane.Core.Parent.ChildLifeController.handle_spec/2
(membrane_core 0.5.2) lib/membrane/core/pipeline/action_handler.ex:53: Membrane.Core.Pipeline.ActionHandler.do_handle_action/4
(membrane_core 0.5.2) lib/membrane/core/pipeline/action_handler.ex:29: Membrane.Core.Pipeline.ActionHandler.handle_action/4
(bunch 1.3.0) lib/bunch/enum.ex:121: anonymous fn/3 in Bunch.Enum.try_reduce/3
(elixir 1.10.2) lib/enum.ex:3686: Enumerable.List.reduce/3
(elixir 1.10.2) lib/enum.ex:2161: Enum.reduce_while/3
(membrane_core 0.5.2) lib/membrane/core/callback_han
Multi.new()
|> Multi.insert(:item_without_hash_id, changeset)
|> Multi.run(:playlist, fn _repo, %{item_without_hash_id: playlist} ->
playlist
|> Playlist.changeset_generate_hash_id()
|> Repo.update()
end)
# iterate over the localized_titles and add to db
# pass in playlist that was just inserted
|> Multi.run(:add_localized_titles, fn _repo, %{playlist: playlist} ->
@mazz
mazz / gist:cb6d69bc76727319e6a19cd28b80caa4
Created February 19, 2020 23:39
decent traefik config
version: '3'
services:
traefik:
container_name: traefik
image: traefik:latest
networks:
- traefik
restart: unless-stopped
command:
version: '3.7'
services:
proxy:
image: traefik:v2.1
container_name: traefik
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
- proxy-network