Skip to content

Instantly share code, notes, and snippets.

Avatar

Oliver Severin Mulelid-Tynes olivermt

  • Microsoft / OMT Tech AS
  • Hamar, Norway
View GitHub Profile
View errors
C:\code\jdk-11\bin\java.exe -Dmaven.multiModuleProjectDirectory=C:\code\safari\api-ktor3 "-Dmaven.home=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.1.2\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.1.2\plugins\maven\lib\maven3\bin\m2.conf" "-Dmaven.ext.class.path=C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.1.2\plugins\maven\lib\maven-event-listener.jar" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.1.2\lib\idea_rt.jar=60024:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.1.2\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.1.2\plugins\maven\lib\maven3\boot\plexus-classworlds-2.6.0.jar;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.1.2\plugins\maven\lib\maven3\boot\plexus-classworlds.license" org.codehaus.classworlds.Launcher -Didea.version2020.1.2 install
[INFO] Scanning for projects...
[INFO]
View transaction.sql
start transaction;
insert into tenants (name) values ('test') returning id; -- id = 1
insert into sub_tenants (tenant_id, name) values (1, 'test');
commit;
-- 'Key (tenant_id)=(1) is not present in table "tenants".
View error.ex
ႋ窝ᬀ退Request: POST /api/v2/graphql
** (exit) an exception was raised:
** (KeyError) key :parent_name not found
(ecto) lib/ecto/repo/queryable.ex:249: anonymous fn/2 in Ecto.Repo.Queryable.process/4
(stdlib) maps.erl:257: :maps.fold_1/3
(ecto) lib/ecto/repo/queryable.ex:249: Ecto.Repo.Queryable.process/4
(ecto) lib/ecto/repo/queryable.ex:219: anonymous fn/3 in Ecto.Repo.Queryable.postprocessor/4
(elixir) lib/enum.ex:1314: Enum."-map/2-lists^map/1-0-"/2
(ecto) lib/ecto/repo/queryable.ex:153: Ecto.Repo.Queryable.execute/4
(ecto) lib/ecto/repo/queryable.ex:18: Ecto.Repo.Queryable.all/3
View channel.ex
def join("room:" <> room_id, _params, socket) do
#this prints
IO.inspect(room_id)
case RoomCtx.find(room_id) do
nil ->
#does not print
IO.inspect("not found")
Logger.debug("[channel:room] attempted to join nonexistent room #{room_id}")
{:error, :not_found}
View gist:7c7b3b3e71e4571d0e1d81d904daa7ff
defp do_send_file(conn, file, opts \\ []) do
path = Path.join(filestorage_path(), file.file_path_hash)
Logger.debug "Streaming file #{path}"
if File.exists?(path) do
conn = case Keyword.has_key?(opts, :attachment) do
true -> put_resp_header(conn, "content-disposition", "attachment; filename=\"#{file.original_file_name}\"")
false -> put_resp_header(conn, "content-disposition", "filename=\"#{file.original_file_name}\"")
end
put_resp_header(conn, "content-type", file.content_type)
|> send_file(200, path)
View reset-test.bat
SET MIX_ENV=fixtures
mix ecto.drop
mix ecto.create
psql -U postgres -c "CREATE EXTENSION IF NOT EXISTS citext WITH SCHEMA public" sow_test
mix ecto.migrate
mix sow.db.fixtures
SET MIX_ENV=
View hex.ex
script/ci/build_release.sh
* creating /home/ubuntu/.mix/archives/hex-0.16.0.ez
* creating /home/ubuntu/.mix/rebar
* creating /home/ubuntu/.mix/rebar3
Running dependency resolution...
** (Version.InvalidRequirementError) 1.6.3 or 1.6.5 or 1.7.1
(hex) lib/hex/version.ex:89: Hex.Version.parse_requirement!/2
(hex) lib/hex/version.ex:23: anonymous fn/3 in Hex.Version.match?/3
(hex) lib/hex/version.ex:98: Hex.Version.cache/2
(elixir) lib/enum.ex:738: anonymous fn/3 in Enum.filter/2
View plug.ex
conn
|> put_status(401)
|> json(%{ "error" => "Token invalid", "invalid" => true })
halt(conn)
View errors.erl
[error] 05:59:13.770 Error in process #PID<0.22274.1> on node :"core@10.0.2.143" with exit value:
{:function_clause,
[{:cowboy_protocol, :parse_method,
["",
{:state, #Port<0.52289>, :ranch_tcp, [:cowboy_router, :cowboy_handler],
false,
[listener: Core.Endpoint.HTTP,
dispatch: [{:_, [],
[{["ws", "v1", "client", "websocket"], [],
Phoenix.Endpoint.CowboyWebSocket,
@olivermt
olivermt / query.sql
Created Mar 7, 2017
[42P01] ERROR: invalid reference to FROM-clause entry for table "locations" Hint: Perhaps you meant to reference the table alias "location".
View query.sql
select
operations.legal_name as legal_name,
operations.operation_name as organization_name,
operations.general_description as general_description,
operations.is_exempt as is_exempt,
operations.does_export,
operations.phone,
operations.url,
operations.year_started,
operations.employees,
You can’t perform that action at this time.