Skip to content

Instantly share code, notes, and snippets.

View mortenjust's full-sized avatar

Morten Just mortenjust

View GitHub Profile
@mortenjust
mortenjust / PROMPT.md
Last active September 23, 2026 19:31
Reproduce Tinycast, Raycast and SuperCmd launcher latency and memory benchmarks on macOS, with identical interactive charts and a Codex prompt.

Prompt for Codex

Run the Tinycast/Raycast/SuperCmd benchmark from this gist on my Mac and generate the supplied visualizations using my measurements. Treat the included README as the measurement specification. Use the provided source and chart templates instead of recreating them from this description.

Set up

  1. Read every file in the gist. Download them into a new task-owned launcher-benchmark directory. Use a fresh runs/<timestamp> directory for this run. Do not overwrite previous measurements or include results from the author's machine.
  2. Inspect the supplied scripts before running them. Use local tools; this requires access to the Mac, not a remote Linux sandbox. If sandboxing blocks process statistics or screen capture, use the normal permission flow rather than assuming the apps or credentials are broken.
  3. Run python3 benchmark.py check. Check compiler availability, app versions, the active main display, and existing Screen Recording/Accessibility permissions. Ask me only for informati
@mortenjust
mortenjust / color-space-converter.tsx
Created May 28, 2024 16:12
Converts dropped image files to sRGB
"use client";
/*
Takes a file via an input
draws it on an offscreencanvas
gets the bitmap from the offscreen canvas
creates an image from the bitmap
displays the image
*/
import { useDropzone } from "react-dropzone";
@mortenjust
mortenjust / ColorInterpolator.swift
Last active September 30, 2024 20:20
Interpolate colors with easing functions
import AppKit
import SwiftUI
/// Based on https://github.com/ipedro/SmoothGradientView
/// See documentation on `interpolate:`
///
/// How to use:
///
/// You can interpolate any array of `CGColor`, `NSColor` or `Color`to any array of any of the 3 supported types.
///
//
// Blobs.swift
// SwiftUI Demos
//
// Created by Morten Just on 1/31/23.
//
import SwiftUI
struct Blobs: View {
//
// DarkModeMasker.swift
// SwiftUI Demos
//
// Created by Morten Just on 1/22/23.
// https://twitter.com/joshguospace/status/1617101052192649216?s=12
import SwiftUI
import Charts
//
// DarkModeMasker.swift
// SwiftUI Demos
//
// Created by Morten Just on 1/22/23.
// https://twitter.com/joshguospace/status/1617101052192649216?s=12
import SwiftUI
import Charts
import SwiftUI
// MARK: Main
struct TwitterBluePlus: View {
@State var topMenuItems : [MenuItem] = [MenuItem(title: "For you", icon: nil), MenuItem(title: "Following", icon: nil)]
@State var selectedIdx = 0
var selected : MenuItem { topMenuItems[selectedIdx] }
@mortenjust
mortenjust / NSImage + withoutAlpha.swift
Created July 22, 2022 07:59
Remove alpha transparency from NSImage
extension NSImage {
func withoutAlpha() -> NSImage? {
// based on https://gist.github.com/mishimay/7b65167cf829e022f46dfa749d018661
guard let cgImage = self.cgImage(forProposedRect: nil, context: nil, hints: nil) else { return nil }
let context = CGContext(data: nil, width: cgImage.width, height: cgImage.height, bitsPerComponent: cgImage.bitsPerComponent, bytesPerRow: cgImage.bytesPerRow, space: cgImage.colorSpace!, bitmapInfo: CGImageAlphaInfo.noneSkipLast.rawValue)!
context.draw(cgImage, in: CGRect(x: 0, y: 0, width: context.width, height: context.height))
guard let newCg = context.makeImage() else { return nil }
return NSImage(cgImage: newCg, size: .zero)
@mortenjust
mortenjust / WeatherKit.ts
Created July 21, 2022 18:29
WeatherKit Typescript types
export interface WeatherKit {
currentWeather: CurrentWeather;
forecastDaily: ForecastDaily;
forecastHourly: ForecastHourly;
}
export interface CurrentWeather {
name?: string;
metadata?: Metadata;
asOf?: Date;
Company: Apple
Product: Apple AR Glasses
Short emotional tagline: The future is closer than it appears
Script:
In our lifetimes we’ve seen technology change our lives
In ways we couldn’t imagine
In the past decade alone, it’s become an extension of who we are
So when we talk about the future
We don’t just mean flying cars and robots
We mean a future where we’re not tethered to our screens