Skip to content

Instantly share code, notes, and snippets.

View njam's full-sized avatar

Reto Kaiser njam

View GitHub Profile
#[test]
fn filter_signal_cloned() {
let list = signal_vec::always(vec![3, 1, 6, 2]).map(Rc::new);
#[derive(Copy, Clone)]
enum FilterOption { Odd, Even }
let filter_option = Rc::new(Mutable::new(FilterOption::Odd));
let mut signal = list
use std::pin::Pin;
use std::rc::Rc;
use std::task::Poll;
use futures_executor::block_on;
use futures_util::future::poll_fn;
use futures_signals::signal::{Mutable, Signal};
use futures_signals::signal_vec::{MutableVec};
use futures_signals::signal_vec::SignalVecExt;
@njam
njam / dominator-headless.rs
Created February 5, 2020 19:21
Rendering rust-dominator app in headless browser with wasm-bindgen-test
use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
use wasm_bindgen_test::wasm_bindgen_test_configure;
use dominator_test::App;
wasm_bindgen_test_configure!(run_in_browser);
#[wasm_bindgen_test(async)]
async fn test_html() {
@njam
njam / restic-backup@.service
Last active February 15, 2020 10:52
restic systemd config
[Unit]
Description=Restic backup %I
[Service]
Type=oneshot
Environment="HOME=%h"
ExecStart=/usr/bin/restic backup $BACKUP_ARGS "${BACKUP_PATH}"
ExecStart=/usr/bin/restic forget --prune $FORGET_ARGS
ExecStart=/usr/bin/restic check