Skip to content

Instantly share code, notes, and snippets.

@superlou
superlou / main.rs
Created April 5, 2023 00:07
Scripting speedy2d with Rhai
use std::time::Instant;
use std::rc::Rc;
use std::cell::RefCell;
use speedy2d::Window;
use speedy2d::window::{WindowHandler, WindowHelper};
use speedy2d::Graphics2D;
use speedy2d::color::Color;
use rhai::{Engine, Scope, AST};
<input value={{value}} oninput={{action (mut this.newValue) value="target.value"}}/>
{{#if isChanged}}
<button {{action "reset"}}>reset</button>
{{/if}}
[Defaults]
length = 0:50
[Room 1]
1:00 End of the Whatever [1:15]
2:30 Another Thing [moved]
2:00 Fish Fry
3:10 Boat Fry
[Room 2]
@superlou
superlou / * INTERCEPT *
Created December 30, 2017 19:39
Partial Intercept Follows
RX CHANNEL: BT-LE-HOGP
RX TARGET: https://goo.gl/8hDe7L
LENGTH: UNEXPECTED/INCOMPLETE
MISSING CHARS (3)
== SOM ==
EGCVTRAO743H4Z_TO?#1TB68E
== EOM ==
@superlou
superlou / main.rs
Created August 13, 2017 14:34
Sending a sender through the channel to get a response
use std::thread;
use std::sync::mpsc;
use std::sync::mpsc::{Sender, SyncSender};
use manager::Manager;
use console::console_task;
use rocket::State;
pub enum BackendMsg {
Quit,
@superlou
superlou / console.rs
Created August 12, 2017 14:26
Getting main thread info into Rocket route
use ::BackendMsg;
use std::io;
use std::sync::mpsc::SyncSender;
pub fn console_task(sender: SyncSender<BackendMsg>) {
let run = true;
while run {
let mut input = String::new();
@superlou
superlou / Configuration.h
Created April 2, 2017 13:05
FLSUN Delta with Marlin 1.1.0-RC8
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@superlou
superlou / config.xml
Created March 16, 2017 17:36
SmallTree SCRAM test
<?xml version="1.0"?>
<scram>
<input-files>
<file>input.xml</file>
</input-files>
<options>
<analysis importance="true" uncertainty="false" ccf="false"/>
<limits>
<product-order>10</product-order>
<mission-time>8760</mission-time>
@superlou
superlou / Configuration.h
Last active July 29, 2022 16:25
FLSUN configuration
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or