Mix.install(
[
{:exgboost, "~> 0.3.1", override: true},
{:nx, "~> 0.6"},
{:exla, "~> 0.5"},
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
| Mix.install( | |
| [ | |
| {:phoenix_playground, "~> 0.1.6"}, | |
| {:phoenix, "~> 1.7.14"}, | |
| {:phoenix_live_view, "~> 1.0.0-rc.1"}, | |
| {:chroma, "~> 0.1.3"}, | |
| {:text_chunker, "~> 0.3.1"}, | |
| {:nx, "~> 0.9.0"}, | |
| {:exla, "~> 0.9.1"}, | |
| {:axon, "~> 0.7.0"}, |
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 asyncio | |
| import psycopg2 | |
| # dbname should be the same for the notifying process | |
| conn = psycopg2.connect(host="localhost", dbname="example", user="example", password="example") | |
| conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT) | |
| cursor = conn.cursor() | |
| cursor.execute(f"LISTEN match_updates;") |
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
| use std::str; | |
| fn main() { | |
| // -- FROM: vec of chars -- | |
| let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}']; | |
| // to String | |
| let string1: String = src1.iter().collect::<String>(); | |
| // to str | |
| let str1: &str = &src1.iter().collect::<String>(); | |
| // to vec of byte |
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
| { | |
| "lib/**/views/*_view.ex": { | |
| "type": "view", | |
| "alternate": "test/{dirname}/views/{basename}_view_test.exs", | |
| "template": [ | |
| "defmodule {dirname|camelcase|capitalize}.{basename|camelcase|capitalize}View do", | |
| " use {dirname|camelcase|capitalize}, :view", | |
| "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
| defmodule MyMap do | |
| @doc """ | |
| flatten given map with nested key. | |
| All keys must be atom or binary. | |
| Returns map | |
| ## Examples |
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
| use_bpm 125 | |
| set_sched_ahead_time! 1 | |
| use_debug false | |
| # Timer Loops ------------------------------------------------------- | |
| live_loop :atom do | |
| sleep 0.25 | |
| end | |
| live_loop :bar, sync: :atom do |