Skip to content

Instantly share code, notes, and snippets.

View felix-schwarz's full-sized avatar

Felix Schwarz felix-schwarz

View GitHub Profile
@schwa
schwa / SwiftUI for macOS Missing Features.md
Last active January 31, 2024 02:45
SwiftUI for macOS Missing Features

https://mastodon.social/@schwa/111801520286334341

My list:

  • Tap location for contextual menus. A lot of apps need to know exactly where a context menu is being triggered from (e.g. canvas style editors etc).
  • Modifier key observation during button presses/gestures etc.
  • Cursor support
  • Native Undo Manager support (SwiftUI has Environment.undoManager but it just exposes Cocoa's UndoManager which doesn't feel very SwiftUI like).
  • Expanded File Dialog options (e.g. adding buttons to the dialog).
  • The outline variant of List (List(… children: …)) is missing a lot of the flexibility of NSOutlineView (TODO: flesh this out with concrete example).
/*******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2023 DigiDNA - www.imazing.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@sporkus
sporkus / notes.md
Created November 11, 2022 04:44
Exposing zfs snapshot to windows previous version using samba vfs_shadow_copy2

Exposing zfs snapshot to windows previous version using samba vfs_shadow_copy2

This was much trickier than I had originally anticipated and have spent a few hours testing.

The config from samba wiki absolutely works, but it wasn't ranked higher in search engine and it's not general enough. https://github.com/zfsonlinux/zfs-auto-snapshot/wiki/Samba

Tested on ubuntu 22.04LTS, samba 4.15.9 and windows 11.

TLDR

@lukaskubanek
lukaskubanek / Bundle+TestFlight.swift
Last active April 17, 2024 18:14
A code snippet for detecting the TestFlight environment for a macOS app at runtime
/// MIT License
///
/// Copyright (c) 2021 Lukas Kubanek, Structured Path GmbH
///
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
@niw
niw / README.en.md
Last active February 13, 2024 04:24
How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

Here is easy steps to try Windows 10 on ARM or Ubuntu for ARM64 on your Apple Silicon Mac. Enjoy!

NOTE: that this is current, 10/1/2021 state.

Running Windows 10 on ARM

  1. Install Xcode from App Store or install Command Line Tools on your Mac
@robksawyer
robksawyer / excludedActivityTypes.swift
Last active March 7, 2024 09:10
A list of UIActivity.ActivityType for modern apps.
let excludedActivityTypes = [
UIActivity.ActivityType.print,
UIActivity.ActivityType.openInIBooks,
UIActivity.ActivityType.copyToPasteboard,
UIActivity.ActivityType.addToReadingList,
UIActivity.ActivityType.assignToContact,
UIActivity.ActivityType.copyToPasteboard,
UIActivity.ActivityType.mail,
UIActivity.ActivityType.markupAsPDF,
UIActivity.ActivityType.postToFacebook,
@IsaacXen
IsaacXen / README.md
Last active April 16, 2024 15:54
(Almost) Every WWDC videos download links for aria2c.
@steipete
steipete / HowToUseURLByResolvingBookmarkDataOnMacCatalyst.md
Last active October 3, 2022 16:32
Using URLByResolvingBookmarkData on Mac Catalyst: Access sandboxed URLs after an app restart.

Here's what needs to be done in order to use security scoped bookmarks on Mac Catalyst:

  1. You need an entitlement: "com.apple.security.files.bookmarks.app-scope" needs to be se to 1.

  2. Pass both NSURLBookmarkCreationWithSecurityScope and NSURLBookmarkCreationSecurityScopeAllowOnlyReadAccess when creating the bookmark.

Note: The headers mark these API as unavailable for iOS, and this indeed does only work on Mac and not iOS. However, Mac Catalyst really is a Mac app, so using these values is fine. In order to allow compilation, use following:

@steipete
steipete / UIWindow+PSPDFAdditions.h
Last active June 1, 2023 18:24
Mac Catalyst: Get the NSWindow from a UIWindow (Updated for macOS 11 Big Sur, also works with Catalina)
// Don't forget to prefix your category!
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface UIWindow (PSPDFAdditions)
#if TARGET_OS_UIKITFORMAC
@stevemoser
stevemoser / IncompatibleAppsList.plist
Created June 20, 2019 19:38
List of 235 apps incompatible with macOS Catalina 10.15
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IncompatiblePaths</key>
<array>
<dict>
<key>Application Name</key>
<string>Sxs Memory Card Driver</string>
<key>Blurb</key>