This file contains 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
docker run --name platform-pg-11 --restart unless-stopped -e POSTGRES_PASSWORD=password -p 127.0.0.1:5432:5432 -v ~/Magic/docker/data/platform-test:/var/lib/postgresql/data -d postgres:11 -N 500 |
This file contains 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
# I'm doing something like this to build queries: | |
@spec match(%Query{}, map, string, map) :: %Query{} | |
def match(current_query, res_a, rel, res_b) | |
when is_map(res_a) and is_map(res_b) do | |
query_string = """ | |
MATCH (#{get_node_var(res_a)}:#{node_name(res_a)} {#{attributes_from_struct(res_a)}}) | |
MATCH (#{get_node_var(res_b)}:#{node_name(res_b)} {#{attributes_from_struct(res_b)}}) | |
WITH #{get_node_var(res_a)}, #{get_node_var(res_b)} |
This file contains 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 Flexphoenix.Endpoint do | |
use Phoenix.Endpoint, otp_app: :flexphoenix | |
socket "/socket", Flexphoenix.UserSocket | |
# Serve at "/" the static files from "priv/static" directory. | |
# | |
# You should set gzip to true if you are running phoenix.digest | |
# when deploying your static files in production. | |
plug Plug.Static, |
This file contains 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 Plug.Anonymous do | |
import Plug.Conn | |
require IEx | |
def init(options), do: options | |
def call(conn, _opts) do | |
anonymous_id = get_session(conn, "anonymous_id") | |
case anonymous_id do |
This file contains 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 Plug.Anonymous do | |
import Plug.Conn | |
require IEx | |
def init(options), do: options | |
def call(conn, _opts) do | |
anonymous_id = get_session(conn, "anonymous_id") |
This file contains 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 Plug.AnonymousTest do | |
use ExUnit.Case, async: true | |
use Plug.Test | |
alias Plug.Session.COOKIE, as: CookieStore | |
require IEx | |
alias Plug.Anonymous | |
defmodule SomeApp do | |
defmodule SomeController do |
This file contains 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 SomeApp do | |
defmodule SomeController do | |
use Plug.Builder | |
plug Plug.Session, | |
store: :cookie, | |
key: "_wankrank_key", | |
signing_salt: "cmwAUEpB", | |
max_age: 86400 | |
plug :fetch_session | |
plug Anonymous |
This file contains 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 Plug.AnonymousTest do | |
use ExUnit.Case, async: true | |
use Plug.Test | |
alias Plug.Session.COOKIE, as: CookieStore | |
require IEx | |
alias Plug.Anonymous | |
defmodule SomeApp do | |
defmodule SomeController do |
This file contains 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 Plug.AnonymousTest do | |
use ExUnit.Case, async: true | |
use Plug.Test | |
alias Plug.Session.COOKIE, as: CookieStore | |
require IEx | |
alias Plug.Anonymous | |
defmodule SomeApp do | |
defmodule SomeController do |
NewerOlder