Skip to content

Instantly share code, notes, and snippets.

Avatar
🇺🇦
Stand with Ukraine

Thiago Holanda unnamedd

🇺🇦
Stand with Ukraine
View GitHub Profile
@unnamedd
unnamedd / MacEditorTextView.swift
Last active Sep 22, 2022
[SwiftUI] MacEditorTextView - A simple and small NSTextView wrapped by SwiftUI.
View MacEditorTextView.swift
/**
* MacEditorTextView
* Copyright (c) Thiago Holanda 2020-2021
* https://twitter.com/tholanda
*
* MIT license
*/
import Combine
import SwiftUI
@unnamedd
unnamedd / BorderlessWindow.swift
Created Dec 30, 2021 — forked from smic/BorderlessWindow.swift
Extension to create borderless windows in SwiftUI
View BorderlessWindow.swift
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 / TextBorderBottom.swift
Last active May 19, 2022
[SwiftUI] Text + Border Bottom
View TextBorderBottom.swift
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)
@unnamedd
unnamedd / Keycodes.swift
Created Mar 17, 2022 — forked from swillits/Keycodes.swift
Swift Keyboard Keycodes
View Keycodes.swift
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 / TextFieldTyped.swift
Last active Feb 19, 2022
[SwiftUI] Wrapping a UITextField into SwiftUI to use different keyboards, e.g: UIKeyboardType.twitter, UIKeyboardType.numbersAndPunctuation
View TextFieldTyped.swift
// Created by Thiago Holanda on 22.06.19.
// twitter.com/tholanda
import SwiftUI
struct ContainerView: View {
@State var decimal = ""
@State var twitter = ""
@State var url = ""
@State var search = ""
@unnamedd
unnamedd / NSImageExtensions.swift
Created Dec 30, 2021 — forked from raphaelhanneken/NSImageExtensions.swift
NSImage extensions for easy resizing, cropping and saving png images.
View NSImageExtensions.swift
//
// NSImageExtensions.swift
//
import Cocoa
extension NSImage {
/// The height of the image.
var height: CGFloat {
@unnamedd
unnamedd / README.md
Created May 13, 2021 — forked from cellularmitosis/README.md
QEMU PowerPC G4 OS X Tiger (10.4) setup
View README.md
@unnamedd
unnamedd / instructions.md
Created May 13, 2021 — forked from openfirmware/instructions.md
QEMU with Mac OS 9 guest *and working audio*
View instructions.md

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).

@unnamedd
unnamedd / ANSI.md
Created Mar 8, 2021 — forked from fnky/ANSI.md
ANSI Escape Codes
View ANSI.md

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1b
  • Decimal: 27
@unnamedd
unnamedd / GitConfigurations.sh
Last active Jan 24, 2021
Git configurations
View GitConfigurations.sh
# // reference: http://www.arthurkoziel.com/2008/05/02/git-configuration/
# Git Configuration
# Here are some useful configuration options for Git. Some of them, like the Bash completion, are OS X specific but should also work if you adjust the paths according to your system of choice.
# Bash completion:
cp /opt/local/etc/bash_completion.d/git ~/.git-bash-completion.sh
echo "[ -f ~/.git-bash-completion.sh ] && . ~/.git-bash-completion.sh" >> ~/.bash_profile
. ~/.bash_profile