This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * MacEditorTextView | |
| * Copyright (c) Thiago Holanda 2020-2021 | |
| * https://twitter.com/tholanda | |
| * | |
| * MIT license | |
| * Modified by https://github.com/cjwcommuny for TextKit 2 | |
| */ | |
| import Combine |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import AppKit | |
| // MARK: - App Icons | |
| func getIcon(file path: String) -> NSImage? { | |
| guard FileManager.default.fileExists(atPath: path) | |
| else { return nil } | |
| return NSWorkspace.shared.icon(forFile: path) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| extension View { | |
| func eraseToAnyView() -> AnyView { | |
| AnyView(self) | |
| } | |
| } | |
| struct SizePreferenceKey: PreferenceKey { | |
| typealias Value = CGSize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.contrib import admin | |
| from django.contrib.admin.models import LogEntry, DELETION | |
| from django.utils.html import escape | |
| from django.urls import reverse | |
| from django.utils.safestring import mark_safe | |
| @admin.register(LogEntry) | |
| class LogEntryAdmin(admin.ModelAdmin): | |
| date_hierarchy = 'action_time' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/swift | |
| // | |
| // - This is just some AppKit boilerplate to launch a window. | |
| // | |
| import AppKit | |
| @available(OSX 10.15, *) | |
| class AppDelegate: NSObject, NSApplicationDelegate { | |
| let window = NSWindow() | |
| let windowDelegate = WindowDelegate() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * MacEditorTextView | |
| * Copyright (c) Thiago Holanda 2020-2025 | |
| * https://bsky.app/profile/tholanda.com | |
| * | |
| * (the twitter account is now deleted, please, do not try to reach me there) | |
| * https://twitter.com/tholanda | |
| * | |
| * MIT license |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| class MyService: NSObject, MyServiceProtocol { | |
| func upperCaseString(_ string: String, withReply reply: @escaping (String) -> Void) { | |
| let response = string.uppercased() | |
| reply(response) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // toggleLaunchAtStartup.swift | |
| // Recents | |
| // | |
| // Created by Phil LaPier on 5/21/15. | |
| // Copyright (c) 2015 Philip LaPier. All rights reserved. | |
| // | |
| // With help from: https://github.com/RamonGilabert/Prodam/blob/master/Prodam/Prodam/LaunchStarter.swift | |
| import Foundation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Change font (ctrl a) | |
| var doc = context.document, | |
| selection = context.selection, | |
| font_name = [doc askForUserInput:"Font name:" initialValue:"Arial"]; | |
| function check_layer(layer){ | |
| log(layer) | |
| var className = layer.className() | |
| log("Checking layer " + layer + " of klass: " + className) | |
| if (className == "MSTextLayer") { |