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
defmodule Schizo do | |
@moduledoc """ | |
A module that lets you **uppercase** and **unvowel** every other word in a sentence. | |
""" | |
@doc """ | |
Uppercases every other word in a sentence. |
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
module Utils.LTree | |
exposing | |
( Forest | |
, Label | |
, Node | |
, createEmptyForest | |
, createForest | |
, createNode | |
, deleteNode | |
, filterNodes |
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
// Replace *lib.rs* in the seed-quickstart project with this file, | |
// then run `cargo make build && cargo make serve`. | |
#[macro_use] | |
extern crate seed; | |
use seed::prelude::*; | |
// Model |
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
//! [Web-sys docs](https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.CanvasRenderingContext2d.html) | |
//! [Web-sys example](https://rustwasm.github.io/wasm-bindgen/examples/2d-canvas.html) | |
//! [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawWindow) | |
#[macro_use] | |
extern crate seed; | |
use seed::prelude::*; | |
use web_sys::HtmlCanvasElement; | |
type Color = &'static str; |
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 { LitElement, html, css } from 'https://unpkg.com/lit-element/lit-element.js?module'; | |
import { unsafeHTML } from 'https://unpkg.com/lit-html/directives/unsafe-html.js?module'; | |
class CodeBlockElement extends LitElement { | |
static get properties() { return { | |
lang: "", | |
code: "", | |
};} | |
render() { |
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
#![feature(track_caller)] | |
use comp_state::*; | |
use comp_state_seed_extras::*; | |
use seed::{prelude::*, *}; | |
use web_sys::{HtmlElement, HtmlTextAreaElement}; | |
#[derive(Default)] | |
struct Model {} |
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 std::any::{Any, TypeId}; | |
#[derive(Debug)] | |
enum Msg { | |
Increment, | |
} | |
fn main() { | |
let handlers: Vec<Handler<Msg>> = vec![ | |
Handler::new(|| Msg::Increment), |
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
#[derive(Debug)] | |
enum Msg { | |
Increment, | |
} | |
// can write procedural macro for derviing | |
impl MsgMarker for Msg {} | |
fn main() { | |
let handlers: Vec<Handler<Msg>> = vec![ |
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 std::any::{Any, TypeId}; | |
#[derive(Debug)] | |
enum Msg { | |
Increment, | |
} | |
// copy-paste from static_assertions crate | |
#[macro_export] | |
macro_rules! assert_type_eq_all { |
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
#![feature(optin_builtin_traits)] | |
//#![feature(negative_impls)] | |
#[derive(Debug)] | |
enum Msg { | |
Increment, | |
Decrement | |
} | |
fn main() { |
OlderNewer