Skip to content

Instantly share code, notes, and snippets.

View robert-hoffmann's full-sized avatar

Robert Hoffmann robert-hoffmann

View GitHub Profile
@robert-hoffmann
robert-hoffmann / doc-add.prompt.md
Last active January 6, 2026 12:43
Copilot prompt and instructions for clean code
mode description
ask
Document a Python file in the project, following specific conventions for style, formatting, and documentation.

Please document the file ${file} following the conventions observed in the project.

CRITICAL: Code Preservation Policy

  • NEVER remove any existing functionality from the code
  • NEVER remove or delete any commented-out sections
@robert-hoffmann
robert-hoffmann / myRouter.js
Created July 4, 2025 20:56
VanillaJS (VueRouter style) Router
const MyRouter = (function(win) {
// Create a safe default route object
const createSafeRoute = (routeData = null) => {
if (!routeData) {
return {
query : {},
path : "",
params: {}
};
}
@robert-hoffmann
robert-hoffmann / sample.html
Last active February 22, 2023 21:04
download img from web and get base64 data
<img/>
@robert-hoffmann
robert-hoffmann / sample.html
Last active February 22, 2023 21:04
upload/download files client-side only
<input type="file" onchange="fileSelected(this)" accept="application/JSON" />
<a
download="settings.json"
target="_blank"
>download</a>
<pre>
<code></code>
</pre>
@robert-hoffmann
robert-hoffmann / fetchFromAirtable.js
Last active May 28, 2021 13:30
Get all records from AirTable with simple Fetch/REST (Vanilla JS)
let airtable = {
// Name of the view (change this)
view: "api",
// Database identifier (change this)
database: "appDatabaseIdentifier",
// Auth Key => Use a client with read-only permissions for security (change this)
auth: "keyAuthKey"
};