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 May 18, 2024 18:56
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.

@NigelEarle
NigelEarle / Knex-Setup.md
Last active May 4, 2024 13:36
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
@rmondello
rmondello / gist:b933231b1fcc83a7db0b
Last active April 5, 2024 07:10
Exporting (iCloud) Keychain and Safari credentials to a CSV file

Exporting (iCloud) Keychain and Safari credentials to a CSV file

Update (October 2021)

Exporting password + one-time code data from iCloud Keychain is now officially supported in macOS Monterey and Safari 15 (for Monterey, Big Sur, and Catalina). You can access it in the Password Manager’s “gear” icon (System Preferences > Passwords on Monterey, and Safari > Passwords everywhere else), or via the File > Export > Passwords... menu item). You shouldn't need to hack up your own exporter anymore.

Original, Obsolete Content (2014)

After my dad died, I wanted to be able to have access any of his online accounts going forward. My dad was a Safari user and used iCloud Keychain to sync his credentials across his devices. I don’t want to have to keep an OS X user account around just to access his accounts, so I wanted to export his credentials to a portable file.

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
@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
}
}
@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);
@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
@stonetip
stonetip / courseAngles.swift
Last active April 20, 2023 20:44
functions to use and smooth course from CLLocationManager and get north angle relative to current angle
var courseAvgX: Double = 0
var courseAvgY: Double = 0
func getVectorAvg(latestReading: Double) -> Double {
let deg2Rad = 180 / Double.pi
// convert reading to radians
var theta = latestReading / deg2Rad
// running average
@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
@Starefossen
Starefossen / remoteDataTableView.swift
Last active January 16, 2023 09:50
Remote JSON Data to tableView in iOS 8.0 (Swift)
import UIKit
import Foundation
import XCPlayground
XCPSetExecutionShouldContinueIndefinitely()
class RemoteAPI {
func getData(completionHandler: ((NSArray!, NSError!) -> Void)!) -> Void {
let url: NSURL = NSURL(string: "http://itunes.apple.com/search?term=Turistforeningen&media=software")
let ses = NSURLSession.sharedSession()