Skip to content

Instantly share code, notes, and snippets.

View DanBurkhardt's full-sized avatar
👓
building Kassandra, a macOS AR app for Nreal Air.

Dan Burkhardt DanBurkhardt

👓
building Kassandra, a macOS AR app for Nreal Air.
View GitHub Profile
@KhaosT
KhaosT / HDMI on Apple Vision Pro.md
Last active March 15, 2024 20:52
Guide for using Apple Vision Pro as HDMI display

Displaying HDMI sources on Apple Vision Pro

While it's possible to stream most content to Apple Vision Pro directly over the internet, having the ability to use Apple Vision Pro as an HDMI display can still be useful.

Since Apple Vision Pro does not support connecting to an HDMI input directly or using an HDMI capture card, we have to be a little creative to make this work. NDI provides the ability to stream HDMI content over a local network with really low latency, and it works great with Apple Vision Pro.

This page shows the setup I’m using.

// ==UserScript==
// @name r/place Alliance of New York Institutions bot
// @namespace http://tampermonkey.net/
// @version 1.0
// @description place tile bot
// @author Credit to Jared.
// @match https://hot-potato.reddit.com/embed*
// @updateURL https://gist.github.com/Alliance-of-New-York/0cd5ba86762b88d649218d92afc7a3cf/raw/placetesla.user.js
// @downloadURL https://gist.github.com/Alliance-of-New-York/0cd5ba86762b88d649218d92afc7a3cf/raw/placetesla.user.js
// @grant GM_xmlhttpRequest

Setup

  • Create a developer account with Apple
  • Download and install X-Code from the Apple App Store
  • Open and run X-Code app and install whatever extras it requires
  • Open the preferences pane (cmd+,)
    • click the + in the lower right corner
    • choose Apple ID
    • enter your apple ID and password
@MojtabaHs
MojtabaHs / ViewRepresentableHelper.swift
Created September 24, 2020 13:20
Representing both AppKit and UIKit Views inside the SwiftUI
#if os(macOS)
public typealias ViewRepresentable = NSViewRepresentable
public typealias NativeView = NSView
#elseif os(iOS)
public typealias ViewRepresentable = UIViewRepresentable
public typealias NativeView = UIView
#endif
public protocol ViewRepresentableHelper: ViewRepresentable {
associatedtype ViewType: NativeView
@trevphil
trevphil / KalmanFilter.swift
Created June 3, 2019 13:24
Kalman Filter for CLLocation
import Foundation
import CoreLocation
extension CLLocation {
// Alias for `horizontalAccuracy` (more readable)
var uncertainty: Double {
return horizontalAccuracy
}
}
@jthomas
jthomas / primes-with-workers.js
Last active April 10, 2022 13:22
Calculating prime numbers on serverless platforms using Node.js Worker Threads and IBM Cloud Functions (Apache OpenWhisk)
'use strict';
const { Worker } = require('worker_threads');
const os = require('os')
const threadCount = os.cpus().length
const compute_primes = async (start, range) => {
return new Promise((resolve, reject) => {
let primes = []
console.log(`adding worker (${start} => ${start + range})`)
@jxsl13
jxsl13 / vulkan_on_macOS.md
Created April 13, 2019 10:46
Installing Vulkan on macOS / Vulkan SDK and GLFW

Installing Vulkan on macOS

Install brew

https://brew.sh

Install the Vulkan SDK on macOS

$ brew cask install apenngrace/vulkan/vulkan-sdk
-- See the most up to date version here where it says "Download the mrc-converter-suite zip archive" https://discussions.agilebits.com/discussion/30286/mrcs-convert-to-1password-utility/p1
--
-- Exports Safari's saved passwords to a CSV file formatted for use with the convert_to_1p4's csv converter
--
-- Version 1.4
-- mike (at) cappella (dot) us
--
use AppleScript version "2.5" -- runs on 10.11 (El Capitan) and later
use scripting additions
@bellbind
bellbind / DisplayMode.swift
Last active October 12, 2023 17:54
[macos][swift4]Switch and Display DisplayMode command and StatusBar Menu app
#!/usr/bin/env swift -import-objc-header cg-hidden.h
// $ swiftc -import-objc-header cg-hidden.h DisplayMode.swift
import Foundation
import CoreFoundation
import CoreGraphics
let display = CGMainDisplayID()
let count = UnsafeMutablePointer<Int32>.allocate(capacity: 1)
defer {count.deallocate()}
CGSGetNumberOfDisplayModes(display, count);
@NigelEarle
NigelEarle / Knex-Setup.md
Last active March 11, 2024 00:18
Setup Knex with Node.js

Knex Setup Guide

Create your project directory

Create and initialize your a directory for your Express application.

$ mkdir node-knex-demo
$ cd node-knex-demo
$ npm init