json = """
[
{
"k1": "v1",
"k2": {
This file contains hidden or 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 MyApp.Repo.Migrations.AddPostgresTriggerAndFunctionForAllTables do | |
| use Ecto.Migration | |
| def up do | |
| # Create a function that broadcasts row changes | |
| execute " | |
| CREATE OR REPLACE FUNCTION broadcast_changes() | |
| RETURNS trigger AS $$ | |
| DECLARE | |
| current_row RECORD; |
This file contains hidden or 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
| list = [ | |
| %{id: 1, k: "k1", name: "name a", text: "text a"}, | |
| %{id: 1, k: "k1", name: "name b", other: "other b"}, | |
| %{id: 1, k: "k2", name: "name k2", other: "other k2"} | |
| ] | |
| keys = [:id, :k] | |
| list | |
| |> Enum.group_by(&Map.take(&1, keys)) |
This file contains hidden or 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 Wx do | |
| @vsn "0.0.2" | |
| @author "Onorio Catenacci" | |
| @author "Dominic Letz" | |
| @last_revision_date "22 May 2019" | |
| @moduledoc """ | |
| Elixir version of the constants found in the wx.hrl file | |
| """ | |
| import Bitwise | |
| require Record |
This file contains hidden or 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
| #!/usr/bin/env elixir | |
| defmodule Canvas do | |
| @behaviour :wx_object | |
| @title "Canvas Example" | |
| @size {600, 600} | |
| def start_link() do | |
| :wx_object.start_link(__MODULE__, [], []) |
OlderNewer