Skip to content

Instantly share code, notes, and snippets.

View modster's full-sized avatar
🧠

EM Greeff modster

🧠
View GitHub Profile
@modster
modster / main.ts
Created April 3, 2025 08:38
hello hono example
import { Hono } from 'hono'
import { logger } from 'hono/logger'
import { poweredBy } from 'hono/powered-by'
const app = new Hono()
app.use( '*', logger(), poweredBy() )
app.get( '/', ( c ) =>
{
@modster
modster / blog.sql
Created April 2, 2025 23:08
SQL file to create db and table
CREATE TABLE articles (
id TEXT PRIMARY KEY,
created_at TEXT DEFAULT (datetime('now')),
title TEXT,
content TEXT
);
@modster
modster / unjs.txt
Created March 17, 2025 01:28
This is a gist created by ofetch.
UnJS is awesome!
@modster
modster / query.dune.sql
Created March 17, 2025 00:39 — forked from 1e9y/analysis.txt
Solana On-Chain Analytics. Week 2
WITH
transfers AS (
SELECT
from_owner,
from_token_account,
to_owner,
to_token_account,
amount,
action,
block_time
@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