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
open Eio | |
let process item = if Random.int 4 = 0 then Error (`Item item) else Ok () | |
let () = | |
Eio_main.run @@ fun env -> | |
let clock = Eio.Stdenv.clock env in | |
(* stream with capacity of 25 limits concurrent execution *) | |
let stream = Eio.Stream.create 25 in | |
let errors = ref [] in |
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
import * as fs from 'fs'; | |
import * as path from 'path'; | |
type Route = { | |
name: string, | |
parameters: string[], | |
path: string, | |
subroutes: Route[], | |
} |
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
fn main() { | |
let nc = match nats::connect("127.0.0.1:4222") { | |
Ok(nc) => nc, | |
Err(err) => panic!("Error: {}", err), | |
}; | |
nc.delete_stream("file_processing"); | |
let stream = nats::jetstream::StreamConfig { | |
name: "file_processing".to_string(), |
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
CREATE TABLE projects ( | |
id BIGINT DEFAULT pseudo_encrypt(nextval('projects_id_seq')), | |
created_by BIGINT REFERENCES profiles(user_id) NOT NULL, | |
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), | |
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NULL, | |
deleted BOOLEAN NOT NULL DEFAULT FALSE, | |
slug VARCHAR(100) DEFAULT NULL, | |
featured_image_id BIGINT REFERENCES images(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
pub mod form2 { | |
use seed::{prelude::*, *}; | |
use seed_hooks::*; | |
#[derive(Clone, Debug)] | |
pub struct FormData { | |
pub name: String, | |
pub color: Option<crate::form_fields::color_picker::Color>, //Option<(i32, f64, f64)>, | |
} |
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
use serde::{Deserialize, Serialize}; | |
#[derive(Clone, Debug, Deserialize, Serialize)] | |
pub enum Session { | |
LoggedIn(crate::entities::user::User), | |
Guest, | |
} | |
pub fn remove_session_from_local_storage() { | |
use seed::browser::web_storage::WebStorage; |
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
use seed::{prelude::*, *}; | |
mod shared; | |
thread_local! { | |
pub static GLOBAL_APP: std::cell::RefCell<Option<seed::app::App<Msg,Model,Vec<Node<Msg>>>>> = std::cell::RefCell::new(None); | |
} | |
const WS_URL: &str = "ws://127.0.0.1:9000/ws"; |
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
newtype Created = Created UTCTime | |
deriving (Show, Read, Eq, Generic, PersistField, PersistFieldSql, Ord) | |
instance FromJSON Created | |
instance ToJSON Created | |
newtype Updated = Updated UTCTime | |
deriving (Show, Read, Eq, Generic, PersistField, PersistFieldSql) | |
instance FromJSON Updated | |
instance ToJSON Updated |
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
import Svg | |
import Svg.Attributes as SvgA | |
import SVGSprites | |
icon : Types.Taco -> (SVGSprites.Sprites -> String) -> List (Svg.Attribute msg) -> Html msg | |
icon taco name attrs = | |
Svg.svg | |
attrs | |
[ Svg.use [ SvgA.xlinkHref (taco.staticUrl ++ "icons/sprites.svg#" ++ (name SVGSprites.sprites)) ] [] | |
] |
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
type alias Model = | |
{ .... | |
, route : Sitemap | |
, querystring : QueryString | |
... } | |
type Msg | |
= RouteTo Sitemap QueryString | |
| RouteChanged Sitemap QueryString |
NewerOlder