Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
| Mix.install( | |
| [ | |
| {:phoenix_playground, "~> 0.1.0"}, | |
| {:openai, "~> 0.6.1"} | |
| ], | |
| config: [ | |
| openai: [ | |
| api_key: System.get_env("OPENAI_API_KEY"), | |
| organization_key: System.get_env("OPENAI_ORGANIZATION_KEY") | |
| ] |
| Application.put_env(:elixir, :ansi_enabled, true) | |
| # IEx shell customization for color | |
| # - Added as a comment: https://thinkingelixir.com/course/code-flow/module-1/pipe-operator/ | |
| # - Original source: https://samuelmullen.com/articles/customizing_elixirs_iex/ | |
| # - Can add to a specific project or can put in the User home folder as a global config. | |
| # Updates from: | |
| # - https://github.com/am-kantox/finitomata/blob/48e1b41b21f878e9720e6562ca34f1ce7238d810/examples/ecto_intergation/.iex.exs | |
| timestamp = fn -> | |
| {_date, {hour, minute, _second}} = :calendar.local_time |
| defmodule NestedWeb.FormLive do | |
| use NestedWeb, :live_view | |
| require Logger | |
| defmodule Form do | |
| use Ecto.Schema | |
| import Ecto.Changeset | |
| embedded_schema do | |
| field :name, :string |
| #!/usr/bin/env bash | |
| DATABASE_URL="postgres://MyPostgresUser:[email protected]:5432/MyPostgresDB" | |
| # `cut` is used to cut out the separators (:, @, /) that come matched with the groups. | |
| DATABASE_USER=$(echo $DATABASE_URL | grep -oP "postgres://\K(.+?):" | cut -d: -f1) | |
| DATABASE_PASSWORD=$(echo $DATABASE_URL | grep -oP "postgres://.*:\K(.+?)@" | cut -d@ -f1) | |
| DATABASE_HOST=$(echo $DATABASE_URL | grep -oP "postgres://.*@\K(.+?):" | cut -d: -f1) | |
| DATABASE_PORT=$(echo $DATABASE_URL | grep -oP "postgres://.*@.*:\K(\d+)/" | cut -d/ -f1) |
| defmodule Commerce.Orders.MockWebsocketServer do | |
| use Plug.Router | |
| plug(:match) | |
| plug(:dispatch) | |
| match _ do | |
| send_resp(conn, 200, "Hello from plug") | |
| end | |
| sudo apt update && sudo apt upgrade -y | |
| sudo apt install apache2 -y | |
| sudo apt install easy-rsa -y | |
| cd /usr/share/easy-rsa | |
| sudo ./easyrsa init-pki | |
| yes "" | sudo ./easyrsa build-ca nopass |
| --- | |
| # Checks if files exists that related to Exaramel Malware | |
| # Ref:https://www.cert.ssi.gouv.fr/uploads/CERTFR-2021-CTI-005.pdf | |
| - name: Setting files to check | |
| set_fact: | |
| maliciousFiles: | |
| - /tmp/.applocktx | |
| - /tmp/.applock | |
| - /usr/local/centreon/www/search.php |
| import Ecto.Query | |
| ... | |
| defmacro store_items_not_exist(store_items_table_name, store_id, item_name) do | |
| args = [ | |
| "NOT EXISTS (SELECT * FROM #{store_items_table_name} item WHERE item.store_id = ? AND item.name == ?)", | |
| store_id, | |
| item_name | |
| ] | |
| name: serverless-mono | |
| description: Serverless mono infrastructure | |
| backend: | |
| url: s3://my-pulumi-state-bucket | |
| runtime: | |
| name: nodejs | |
| options: | |
| typescript: false | |
| lock: | |
| region: ap-southeast-2 |