Skip to content

Instantly share code, notes, and snippets.

View vheathen's full-sized avatar

Vladimir Drobyshevskiy vheathen

View GitHub Profile
@vheathen
vheathen / parser.ex
Last active March 5, 2018 14:17
Just (poor) example of a parser in Elixir lang
defmodule IasipApi.Parsers.NioktrParser do
require Logger
# TODO: redesign component and split functional and supportive parts into modules
@empty_org %{
okopf: "",
f_name: "",
s_name: "",
founder: "",
@vheathen
vheathen / step2.ex
Created February 20, 2018 20:38
Channel's injectable module example
defmodule ProfileWeb.CustomerChannel.Step2 do
@moduledoc """
This module adds the application step 2 handlers to the channel
"""
defmacro __before_compile__(_env) do
quote do
def proceed_incoming("step2",
payload,
@vheathen
vheathen / ceph.conf
Created March 3, 2017 12:22
ceph multi-root
# ...
[osd]
# Don't update crush map on start - double root
osd crush update on start = false
# ...
@vheathen
vheathen / web_channels_playlists_user_channel.ex
Last active August 8, 2016 12:45
Elixir + Phoenix Channels memory consumtion
defmodule Myapp.PlaylistsUserChannel do
use Myapp.Web, :channel
import Ecto.Query
alias Myapp.Repo
alias Myapp.Playlist
alias Phoenix.Socket.Message