Skip to content

Instantly share code, notes, and snippets.

View modster's full-sized avatar
🧠

EM Greeff modster

🧠
View GitHub Profile
@modster
modster / index.html
Created January 15, 2025 02:50
responsive
<div id="editor">
<div id="view"><canvas id="c"></canvas></div>
<div id="controls">
<div>
<p>various controls
would appear here</p>
<div>Drag this bar</div>
<div>⇐</div>
</div>
@modster
modster / sqlite.md
Created January 13, 2025 03:35
Deno SQLite3

Tags Doc Checks License Sponsor

The fastest and correct module for SQLite3 in Deno.

# resizeObserver
If you want to prevent these errors, the solution depends on what your intended effect is. If you actually intend to have an infinite loop, you just need to defer the resizing code in your ResizeObserver callback to after the browser repaints. You can put it into a requestAnimationFrame callback.
## 1
```js
const divElem = document.querySelector("body > div");
const resizeObserver = new ResizeObserver((entries) => {
@modster
modster / responsive-iframe.md
Created January 11, 2025 22:33
Responsive Iframe

Responsive iframe

link

This example demonstrates how to implement a responsive iframe using Observable Framework such that the height of the iframe automatically adjusts to show all of the content without scrolling. This example also demonstrates how to turn off Framework’s additional user interface elements (such as the sidebar) so that the embedded page contains only content.

Try resizing the width of the iframe using the slider below; notice that the height adjusts automatically.

const iframeWidth = view(Inputs.range([200, 640], {step: 1, value: document.querySelector("#observablehq-main").offsetWidth, label: "Width"}));
@modster
modster / README.md
Created January 6, 2025 01:36
Three.js - Responsive
@modster
modster / index.js
Created June 8, 2024 08:27 — forked from stevedylandev/index.js
Mint an NFT Using Pinata and Crossmint
// Run `npm install form-data node-fetch fs dotenv`
//
// Create a separate .env file with the following variables completed
// PINATA_JWT=
// CROSSMINT_PROJECT_ID=
// CROSSMING_CLIENT_SECRET=
//
// Read more on how this works at
@modster
modster / index.js
Created June 8, 2024 08:27 — forked from stevedylandev/index.js
Mint an NFT Using Pinata and Crossmint
// Run `npm install form-data node-fetch fs dotenv`
//
// Create a separate .env file with the following variables completed
// PINATA_JWT=
// CROSSMINT_PROJECT_ID=
// CROSSMING_CLIENT_SECRET=
//
// Read more on how this works at
@modster
modster / p256verify.sh
Created February 8, 2024 04:10 — forked from ulerdogan/p256verify.sh
Testing command for RIP-7212
RPC="https://polygon-mumbai.blockpi.network/v1/rpc/public"
P256VERIFY="0x0000000000000000000000000000000000000100"
CALLDATA="4cee90eb86eaa050036147a12d49004b6b9c72bd725d39d4785011fe190f0b4da73bd4903f0ce3b639bbbf6e8e80d16931ff4bcf5993d58468e8fb19086e8cac36dbcd03009df8c59286b162af3bd7fcc0450c9aa81be5d10d312af6c66b1d604aebd3099c618202fcfe16ae7770b0c49ab5eadf74b754204a3bb6060e44eff37618b065f9832de4ca6ca971a7a1adc826d0f7c00181a5fb2ddf79ae00b4e10e"
echo "testing RIP-7212 on Mumbai"
cast call --rpc-url ${RPC} ${P256VERIFY} --data ${CALLDATA}
@modster
modster / app1.js
Created June 13, 2023 20:20 — forked from prof3ssorSt3v3/app1.js
Express JS Routing examples for YouTube video series on Express
//Starter version of the main app.js file
"use strict";
const express = require("express");
const app = express();
const port = process.env.port || 4444;
app.get("/", (req, res) => {
//handle root
});
@modster
modster / index.html
Created June 13, 2023 02:36 — forked from prof3ssorSt3v3/index.html
Code from video about using the chrome dev tools console
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@300&display=swap" rel="stylesheet" />