Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris cmidgley

  • Northborough, MA
View GitHub Profile
@cmidgley
cmidgley / main.js
Created May 23, 2022
Simple websocket continuous send/receive test
View main.js
/*
* Copyright (c) 2016-2019 Moddable Tech, Inc.
*
* This file is part of the Moddable SDK.
*
* This work is licensed under the
* Creative Commons Attribution 4.0 International License.
* To view a copy of this license, visit
* <http://creativecommons.org/licenses/by/4.0>.
* or send a letter to Creative Commons, PO Box 1866,
@cmidgley
cmidgley / websocket.js
Created May 23, 2022
Refactored WebSocket with debug code
View websocket.js
/*
* Copyright (c) 2016-2022 Moddable Tech, Inc.
*
* This file is part of the Moddable SDK Runtime.
*
* The Moddable SDK Runtime is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
@cmidgley
cmidgley / main.js
Created May 19, 2022
WeakMap crash with preload
View main.js
import { MyClass } from './myclass';
const weak = new WeakMap();
weak.set(MyClass, {});
trace('Success\n');
View gist:787e9369522cea3bb118565686a0a77d
This file has been truncated, but you can view the full file.
{
editorVersion: '1.65.2',
pluginVersion: '1.0.334',
editorType: 'VSCode',
osVersion: 'linux 5.10.102.1-microsoft-standard-WSL2',
nodeVersion: 'v16.14.2',
coreVersion: '1.0.1253',
checksum: 'OTMyZDExYWM3ZDhkZjBkYWQ1Mjk5Y2I0ODExZWNlOWUsMTY3OTA5NzYwMDAwMCww',
config: {
@cmidgley
cmidgley / RtcMemory.c
Created Jan 31, 2022
RTC memory on ESP32 with Moddable HostBuffer
View RtcMemory.c
/*
* Copyright (c) 2022 Chris Midgley
*
* This work is licensed under the
* Creative Commons Attribution 4.0 International License.
* To view a copy of this license, visit
* <http://creativecommons.org/licenses/by/4.0>.
* or send a letter to Creative Commons, PO Box 1866,
* Mountain View, CA 94042, USA.
*/
@cmidgley
cmidgley / moddable-global.d.ts
Created Dec 14, 2021
io/system and SES typings
View moddable-global.d.ts
/*### xs.d.ts start ###*/
/*
Types for io/system
*/
declare class Timer {}
declare type TimerCallback = (timer?: Timer) => void;
declare class System {
static restart(): void;
View gist:4dcb012272d797b1c4fc3846e172271c
{
editorVersion: '1.62.3',
pluginVersion: '1.0.319',
editorType: 'VSCode',
osVersion: 'linux 5.10.60.1-microsoft-standard-WSL2',
nodeVersion: 'v16.13.1',
coreVersion: '1.0.1185',
checksum: 'OTMyZDExYWM3ZDhkZjBkYWQ1Mjk5Y2I0ODExZWNlOWUsMTY3OTA5NzYwMDAwMCww',
config: {
tests: [
@cmidgley
cmidgley / main.js
Last active Nov 24, 2021
Lora ST127x main example
View main.js
import Timer from "timer";
import LoRa_ST127x, { LoRa_Heltec_Wifi_Lora_32_v2_pins } from "lora_st127x";
import config from "mc/config";
let lora;
// test settings
const transmit = parseInt(config.transmit ?? "0"); // true to transmit, false to receive
const useReadCallback = true; // true to use callbacks on read, false to use polling
const usePreallocatedBuffer = true; // set to true to test preallocated buffers, false to test dynamic allocation buffers (when useReadCallback is false)
@cmidgley
cmidgley / LoRa-ST127x.js
Last active Nov 25, 2021
LoRa-ST127x.js (moddable JS)
View LoRa-ST127x.js
/*
* This is a Moddable JS implementation of a LoRa driver for the ST127x chipset,
* such as found on the Heltec Wifi LoRa 32 V2 board. It is a port of the C++
* ESP-IDF driver (https://github.com/Inteform/esp32-lora-library, has no copyright
* or license), which is a port of an Arduino C++ LoRa driver (which does have a
* copyright and license, included herein, https://github.com/sandeepmistry/arduino-LoRa)
*
* MIT License
*
* Copyright (c) 2021 Christopher W. Midgley
@cmidgley
cmidgley / Voron 24 SuperSlicer.ini
Created Oct 18, 2021
SuperSlicer Voron 2.4 PLA
View Voron 24 SuperSlicer.ini
[print:Voron 2.4-AB-0.2mm FAST]
allow_empty_layers = 0
avoid_crossing_not_first_layer = 1
avoid_crossing_perimeters = 0
avoid_crossing_perimeters_max_detour = 0
bottom_fill_pattern = rectilinear
bottom_solid_layers = 3
bottom_solid_min_thickness = 0
bridge_acceleration = 1000
bridge_angle = 0