Skip to content

Instantly share code, notes, and snippets.

View unnamedd's full-sized avatar
🇺🇦
#StandWithUkraine

Thiago Holanda unnamedd

🇺🇦
#StandWithUkraine
View GitHub Profile
@unnamedd
unnamedd / MacEditorTextView.swift
Last active April 16, 2024 10:18
[SwiftUI] MacEditorTextView - A simple and small NSTextView wrapped by SwiftUI.
/**
* MacEditorTextView
* Copyright (c) Thiago Holanda 2020-2021
* https://twitter.com/tholanda
*
* MIT license
*/
import Combine
import SwiftUI
@unnamedd
unnamedd / .gitconfig
Last active March 14, 2024 13:19
Personal Git Configurations / Git Config
[core]
excludesfile = /Users/unnamedd/.gitignore
editor = code
autocrlf = false
pager = delta
[user]
name = Thiago Holanda
email = unnamedd@gmail.com
signingkey = CD1B6C70016B3BD91C38BC49F94B6756E6B6D57A
[alias]
@unnamedd
unnamedd / README.md
Created May 13, 2021 11:51 — forked from cellularmitosis/README.md
QEMU PowerPC G4 OS X Tiger (10.4) setup
@unnamedd
unnamedd / instructions.md
Created May 13, 2021 11:49 — forked from openfirmware/instructions.md
QEMU with Mac OS 9 guest *and working audio*

QEMU Mac OS 9 Instructions

Here is a short guide on how to build QEMU to run Mac OS 9 with working audio. These instructions work for MacOS High Sierra as the host OS, although with some tweaking they may run under Linux/Windows. You should be comfortable compiling software from source before attempting.

Clone QEMU fork

Adapted from instructions from Cat_7

You may need to install XCode and/or the XCode command line tools. If you do not have them, then this process may prompt you to install them (MacOS will do that).

extension NSAttributedString {
func highlighting(_ substring: String, using color: UIColor) -> NSAttributedString {
let attributedString = NSMutableAttributedString(attributedString: self)
attributedString.addAttribute(.foregroundColor, value: color, range: (self.string as NSString).range(of: substring))
return attributedString
}
}
// Usage:
@unnamedd
unnamedd / NSImageExtensions.swift
Created December 30, 2021 00:26 — forked from raphaelhanneken/NSImageExtensions.swift
NSImage extensions for easy resizing, cropping and saving png images.
//
// NSImageExtensions.swift
//
import Cocoa
extension NSImage {
/// The height of the image.
var height: CGFloat {
@unnamedd
unnamedd / BorderlessWindow.swift
Created December 30, 2021 10:31 — forked from smic/BorderlessWindow.swift
Extension to create borderless windows in SwiftUI
import SwiftUI
extension CGRect {
fileprivate func point(anchor: UnitPoint) -> CGPoint {
var point = self.origin
point.x += self.size.width * anchor.x
#if os(macOS)
point.y += self.size.height * (1 - anchor.y)
#else
point.y += self.size.height * anchor.y
@unnamedd
unnamedd / Keycodes.swift
Created March 17, 2022 21:43 — forked from swillits/Keycodes.swift
Swift Keyboard Keycodes
struct Keycode {
// Layout-independent Keys
// eg.These key codes are always the same key on all layouts.
static let returnKey : UInt16 = 0x24
static let enter : UInt16 = 0x4C
static let tab : UInt16 = 0x30
static let space : UInt16 = 0x31
static let delete : UInt16 = 0x33
static let escape : UInt16 = 0x35
@unnamedd
unnamedd / rust_to_swift.md
Created December 7, 2023 18:19 — forked from surpher/rust_to_swift.md
Building binaries from Rust to iOS/macOS (PactSwift specific)
@unnamedd
unnamedd / TextBorderBottom.swift
Last active September 11, 2023 21:54
[SwiftUI] Text + Border Bottom
var body: some View {
Group {
Text(language.name)
.font(.body)
.padding([.leading, .trailing], 10)
.padding([.top, .bottom], 5)
.background(Color.gray)
.overlay(
Rectangle()
.frame(height: 4)