Skip to content

Instantly share code, notes, and snippets.

View wallabyway's full-sized avatar

Michael Beale wallabyway

View GitHub Profile

View Revit Model in Browser

To create a simple 'View Revit Model in a Browser', use this prompt in Cursor:

Create a minimal Python Flask backend (with /api/token, /api/upload, /api/status/<urn>, and /api/list endpoints using .env containing APS client ID, secret, and bucket name in utils.py). 
Use `/signeds3upload` and `/batchcompleteupload` endpoint for the upload, encode the urn f"urn:adsk.objects:os.object:{BUCKET_KEY}/{urn}" and then translate to svf2.
Finally, create a index.html frontend with an upload button and a combo box to upload, translate, and view .rvt models using the Autodesk Viewer SDK. 
No comments or error checking, using only server.py, utils.py, and index.html.
@wallabyway
wallabyway / openapi_to_llms.py
Last active June 11, 2025 01:19
Combine many OpenAPI / Swagger specs into one llms.txt file. Use 4o-mini to summarize and condense.
#!/usr/bin/env python3
"""
combine_openapi_to_markdown.py
--------------------------------
Generate a single Markdown reference from many OpenAPI specs,
including links to:
• raw YAML file (…/yaml/ssa.yaml)
• examples file (…/yaml/ssa-examples.md)
@wallabyway
wallabyway / compress_ply.py
Created May 10, 2025 00:35
3DGS SOGS compression - for Apple M1 Metal - based on https://github.com/playcanvas/engine/pull/7510
#!/usr/bin/env python3
"""
Compress a Gaussian‑splat PLY using gsplat’s PNG compressor,
but target Apple‑Silicon/Metal rather than CUDA.
Example
-------
python compress_ply_mps.py \
--ply my_scene.ply \
--output-dir ./compressed
@wallabyway
wallabyway / getLevelElevations.mjs
Created August 15, 2024 23:05
getLevelElevations.mjs - a lambda fn, This script is designed to retrieve and display elevation data (ceiling and floor heights) for a specified building level using Autodesk APS APIs. It automates the process of downloading necessary JSON files (manifest.json and AECModelData.json) and extracting the required data based on user input.
// STEPS:
// 1. Retrieve manifest.json
// 2. Retrieve aecmodeldata.json
// 3. given a #level, use it to create a bounding box, for LMV viewer, as a client side filter string
// INPUTS:
// level, URN, Access-token
https://developer.api.autodesk.com/modelderivative/v2/designdata/dXJuOmFkc2sub2JqZW....xlX3Byb2plY3QucnZ0/manifest
import fetch from 'node-fetch';
@wallabyway
wallabyway / refresher.js
Last active July 26, 2024 01:48
token-refresher.js
#!/usr/bin/env node
// npm install commander dotenv open
// chmod +x refresher.js
import http from 'http';
import { program } from 'commander';
import open from 'open';
import dotenv from 'dotenv';
import fs from 'fs';
import crypto from 'crypto';
@wallabyway
wallabyway / lambda_function.py
Last active July 12, 2024 00:15
SSA Token generator on Lambda (minimal)
# https://gist.github.com/wallabyway/3efdaf7ab52368cd019678b027055bd1
import jwt
import time
import requests
import os
def generate_jwt_assertion(kid, private_key, APS_clientID, SSA_oxygenID, scope):
current_time = int(time.time())
claims = {
"iss": APS_clientID,
@wallabyway
wallabyway / simplesearch.js
Created July 10, 2024 20:20 — forked from N8python/simplesearch.js
It's pretty simple to make a half-decent search agent.
import googleIt from 'google-it';
import axios from 'axios';
import cheerio from 'cheerio';
import OpenAI from 'openai';
import readlineSync from 'readline-sync';
const openai = new OpenAI({
baseURL: "http://localhost:1234/v1",
apiKey: 'My API Key'
});
@wallabyway
wallabyway / handler.js
Created April 29, 2024 20:50
Tandem Connect - code block support for ES6, async/await and modules, anti lint
/* jshint esversion: 8 */
'use strict'
const axios = require('axios');
/**
* Handler function that will process the data and return a result.
*
* @param {Object} data - Data to be processed.
* @param {Objcct} logger - Can be used for any logging purposes.
* @param {Function} logger.log - Use to log anything i.e. logger.log(Object | String)
@wallabyway
wallabyway / package.json
Created May 16, 2023 06:12
minimal powerBI visual component with three.js (spinning grid)
{
"name": "visual",
"description": "default_template_value",
"repository": {
"type": "default_template_value",
"url": "default_template_value"
},
"license": "MIT",
"scripts": {
"pbiviz": "pbiviz",
<head>
<title>Viewer Loading Multi-Model with GLB</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="data:,">
<style>
#panel {
position: fixed; z-index: 2; margin: 10px;
font-family:arial; font-size:1.5em; }
</style>