Skip to content

Instantly share code, notes, and snippets.

@mpottinger
mpottinger / Cargo.toml
Created July 21, 2025 12:48
macOS Screenshot OCR - Rust app using Vision framework for real-time text detection in screenshots
[package]
name = "macos_screenshot_ocr"
version = "0.1.0"
edition = "2024"
[dependencies]
cocoa = "0.25"
core-foundation = "0.9"
@mpottinger
mpottinger / Cargo.toml
Last active July 21, 2025 12:48
macOS Active Apps - Rust library for getting visible applications with windows on screen
[package]
name = "macos_active_apps"
version = "0.1.0"
edition = "2021"
[lib]
name = "macos_active_apps"
path = "src/lib.rs"
# Optional test binary for direct testing
@mpottinger
mpottinger / plugin.kts
Created July 14, 2025 19:22
copilot_automation
// plugin.kts copilot_automation_clean – Copilot Automation Tool Window with Agent Chat Copy Feature
import liveplugin.*
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.project.Project
import com.intellij.openapi.project.ProjectManager
import com.intellij.openapi.project.ProjectManagerListener
import com.intellij.openapi.fileEditor.FileEditorManager
import com.intellij.openapi.fileEditor.OpenFileDescriptor
import com.intellij.openapi.vfs.LocalFileSystem
import com.intellij.openapi.vfs.VirtualFileManager
// ------------------------------------------------------------
// LivePlugin: Jetty HTTP Command Server (IDE control) – FULL VERSION
// Writes its listening port to jetbrains_automation.port file in project root.
// CORS fixed for browser HTML UI.
// Now includes comprehensive run tabs API endpoints.
// -- MODIFIED: 'Agent Terminal' is now its own bottom-aligned tool window. --
// ------------------------------------------------------------
//
// ── Jetty & Jakarta Servlet JARs ──
// add-to-classpath $HOME/.m2/repository/org/eclipse/jetty/jetty-server/11.0.15/jetty-server-11.0.15.jar
@mpottinger
mpottinger / autocomplete_groq.zip
Created May 13, 2025 00:23
autocomplete_inline_live_plugin_kotlin
This file has been truncated, but you can view the full file.
PK
ӆ�Zautocomplete_groq/lib/PKӆ�Z+autocomplete_groq/lib/autocomplete_groq.jar}zeP�K�-�]�����ہ@��vp'���� �����-h�w�W3�N�����Wݫ���]{��KEb>�J�BQRC�YVI�UQLIVJR]�EQ�} �Nqb\A��eE��ajb�A�m�s�p�
BE����/�����x�_�?/p�q1��cq��iRW�� C�<�F���QcM^>���J��d�`��iO���/��f�\���di6��|t!A�#�p��{r�Ov
`�C���5�����z��q�2��5��5���q�|���8�&2��l%�ϲI��C�i"�[�Y}��a3�d��.�lq.}2����O��[��+o�)M>�X��3��C�������=ZX�郜3��/ZU2X�)'���[Ig��?C�����~Zȯȓ1.��ϕ�����t��"�RlJfLݣ $h� JU}� ���.(�N��r2HE�-�۱a=���8ح5j�� D��t T����3�qGw� ʓ铹�u�A��������U^������y��A��Z����Ԙ8��h{I�_����tl�=��`����0
�XH�v��S4��������׍T����� G*vc'�N$w�e��i��U���z)����ă��ւ?�e|OA� D�?
�vb�M,���̵�e�7g �E��?��u�,F�Q�����,I���j2�jtI*w��ɍ�ˎOY�/��n�YN�~ӯS�������u~mlV @����)��;��{#�kϒ�@�繡pȭ� ���ec�`�yM�Dy�Ҍb_���C��:j�<�fmBߕ&��\���oF���Vk1�19��L�q�<��3�A@i=�(v�xy1�� �L`�:� ��]g�)�|8
$��G�^
#sl�魖����!3�D+ M"�a]��{ v���.4f�h�t߸\e.�����
import json
from flask import Flask, request, render_template_string
app = Flask(__name__)
HTML = '''
<!DOCTYPE html>
<html lang="en">
<head>
import os
import sys
import openai
# for openai
openai.api_key = "<your openai api key>"
tokens_used = 0
def get_reply(messages):
#include "VDBVolume.h"
// OpenVDB
#include <openvdb/Types.h>
#include <openvdb/math/DDA.h>
#include <openvdb/math/Ray.h>
#include <openvdb/openvdb.h>
#include <Eigen/Core>
#include <algorithm>
// Raycast render of the tsdf volume given a projection matrix and a camera pose
// The camera pose is the pose of the camera in the world coordinate system
// The projection matrix is the projection matrix of the camera
// The output is a vector of pixels, each pixel is a vector of 3 floats
std::vector<std::vector<float>> VDBVolume::Raycast(const Eigen::Matrix4d &projection,
const Eigen::Matrix4d &camera_pose) {
// Get the "unsafe" version of the grid accessors
auto tsdf_acc = tsdf_->getUnsafeAccessor();
auto weights_acc = weights_->getUnsafeAccessor();
auto colors_acc = colors_->getUnsafeAccessor();
namespace vdbfusion {
VDBVolume::VDBVolume(float voxel_size, float sdf_trunc, bool space_carving /* = false*/)
: voxel_size_(voxel_size), sdf_trunc_(sdf_trunc), space_carving_(space_carving) {
tsdf_ = openvdb::FloatGrid::create(sdf_trunc_);
tsdf_->setName("D(x): signed distance grid");
tsdf_->setTransform(openvdb::math::Transform::createLinearTransform(voxel_size_));
tsdf_->setGridClass(openvdb::GRID_LEVEL_SET);
weights_ = openvdb::FloatGrid::create(0.0f);