Skip to content

Instantly share code, notes, and snippets.

View jamischarles's full-sized avatar

Jamis Charles jamischarles

View GitHub Profile
@jamischarles
jamischarles / Module 0: Pre-reqs.md
Last active April 29, 2023 05:22
Hardware / Arduino hacking True Beginner guide 101

Module 0: What you'll need to get started

Notes: Intro (All the cool stuff you can build)

M1 (should m1 be blinking light alone?) Then we reinforce it with each module…

@jamischarles
jamischarles / inlineJS.ts
Created April 16, 2024 18:51
Inline JS into the dom. Careful. ensure you're running this through a build step of some sort to avoid browser errors
/**
* Stringifies a function, and wraps it in an IIFE so it'll auto execute.
* @remarks The assumption is that you'll be inlining this function into a vanilla \<script\> tag on the page.
* Therefore you should follow these rules:
* Standalone code. No imports / or deps on other files / methods.
* You can use TS, but carefully watch how the output is compiled down to ensure it works for the lowest browser target.
* Ensure safety. Anything that can fail should likely be wrapped in a try/catch.
* This will likely be used as blocking js. Keep it short!
* @param parameter1 - Allows passing a 1/2 string|number param to the function to be inlined.
* @param parameter2 - Allows passing a 2/2 string|number param to the function to be inlined.