Skip to content

Instantly share code, notes, and snippets.

View gibbsdigital's full-sized avatar

Tristan Gibbs gibbsdigital

View GitHub Profile
@martinwoodward
martinwoodward / mermaid.md
Created February 11, 2022 20:34
GitHub HTML Rendering Pipeline
```mermaid
sequenceDiagram
    participant dotcom
    participant iframe
    participant viewscreen
    dotcom->>iframe: loads html w/ iframe url
    iframe->>viewscreen: request template
    viewscreen->>iframe: html & javascript
 iframe->>dotcom: iframe ready
let widget = await createWidget();
// Check where the script is running
if (config.runsInWidget) {
// Runs inside a widget so add it to the homescreen widget
Script.setWidget(widget);
} else {
// Show the medium widget inside the app
widget.presentSmall();
}
@matthri
matthri / unofficial_devto.js
Created December 27, 2020 18:46
Unofficial dev.to iOS widget
const API_KEY = "paste API key here";
const ARTICLE_PARAMS = [{ per_page: "10" }, { top: "1" }];
let widget = await createWidget();
// Check where the script is running
if (config.runsInWidget) {
// Runs inside a widget so add it to the homescreen widget
Script.setWidget(widget);
} else {
@joshuabradley012
joshuabradley012 / Object collisions with canvas
Last active June 3, 2025 18:30
An example of 2D collisions using JavaScript Canvas
class State {
constructor(display, actors) {
this.display = display;
this.actors = actors;
}
update(time) {
/**
* provide an update ID to let actors update other actors only once