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
to_sql = fn (q) -> | |
q | |
|> (&Ecto.Adapter.Queryable.plan_query(:all, Ecto.Adapters.Postgres, &1)).() |> elem(0) | |
|> Ecto.Adapters.Postgres.Connection.all() | |
|> List.to_string |> IO.puts() | |
end |
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
{ | |
"cmake.pinnedCommands": [ | |
"workbench.action.tasks.configureTaskRunner", | |
"workbench.action.tasks.runTask" | |
], | |
"cmake.showConfigureWithDebuggerNotification": false, | |
"cmake.showOptionsMovedNotification": false, | |
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
-module(pkcs7_demo). | |
% reduced example for issue in github.com/erlang/otp | |
-compile([export_all]). | |
-include_lib("public_key/include/public_key.hrl"). | |
pkcs7_verify(Message, #'SignedData'{version = Vsn} = SD, Config) -> | |
Vsn == sdVer1 orelse erlang:error({unsupported_version, Vsn}), | |
#'SignedData'{ |
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 DbcEpgsql do | |
# really basic dbconnection impl for postgres using epgsql | |
# * no status support | |
# * no savepoints and nested transactions | |
# * no error handling | |
# * hardcoded connection params | |
# | |
# BUT: tests with tracing enabled for quick understanding what's going on | |
# just change params in connect/1, run DbcEpgsql.Test.query in iex and start exploring what's going on | |
# $ iex -S mix |
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 Laundry.Logger do | |
require Logger | |
def install() do | |
%{ | |
[:phoenix, :router_dispatch, :stop] => &__MODULE__.request_finish/4, | |
} |> Enum.each(fn {key, handler} -> | |
:telemetry.detach({__MODULE__, key}) | |
:telemetry.attach({__MODULE__, key}, key, handler, :ok) | |
end) |
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
import io.undertow.Handlers | |
import io.undertow.Undertow | |
import io.undertow.servlet.Servlets | |
import io.undertow.servlet.Servlets.servlet | |
import java.util.* | |
import java.util.concurrent.CompletableFuture | |
import java.util.concurrent.ConcurrentHashMap | |
import java.util.concurrent.TimeUnit | |
import java.util.stream.Collectors | |
import javax.servlet.http.HttpServlet |
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
cp jdk1.8.0_201/jre/ ~/jre1.8/ | |
cp -r jdk1.8.0_201/jre/ ~/jre1.8/ | |
ls jre1.8/ | |
export JAVA_HOME=`readlink -m ~/jre1.8` | |
export JAVA_TOOL_OPTIONS="-Djava.util.prefs.systemRoot=$JAVA_HOME/.prefs" | |
export PATH="$JAVA_HOME/bin:$PATH" | |
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
def show(conn, _params) do | |
invoice_id = get_session(conn, :invoice_id) | |
invoice_access_token = get_session(conn, :access_token) | |
cond | |
is_nil(invoice_id) or is_nil(invoice_access_token) -> render_error(conn, _params) | |
_ -> render_form(conn, invoice_id, invoice_access_token) | |
end | |
end | |
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
Вот у меня на приеме сидит, допустим, Петя. Он пришел ко мне вместе со своей девушкой и хочет избавиться от своего пристрастия к кокаину. «Нюхал» он последний раз около месяца назад, выглядит абсолютно нормально, одет стильно, работает в престижной фирме. Между нами происходит диалог, который я привожу с некоторыми сокращениями: | |
«- От чего вы собираетесь лечиться, Петя? | |
-Ну, от кокаина. | |
-Петя, кокаин – не вирус, он самостоятельно в нос залететь не может. | |
-…Ну, нюхаю я. |
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
Жил-был злой волшебник. Ему было уже лет 500, а может 1000. Когда он | |
начинал дряхлеть, он находил где-нибудь юную девушку, заточал ее в | |
башню и много дней подвергал всяческим истязаниям. Из ее страданий он | |
извлекал жизненную силу, и к моменту, когда жертва погибала, он | |
становился молодым. Очередной раз одряхлев, он купил на рынке тупую и | |
некрасивую рабыню. Настолько тупую, что предшествующий владелец, | |
убедившись, что на нее не действуют даже побои, продавал ее по дешевке | |
(колдун был жаден, а кроме здоровья и молодости от жертвы ничего не | |
требовалось). | |
В своей башне он немедленно приступил к истязанию. Первые дни |
NewerOlder