Skip to content

Instantly share code, notes, and snippets.

Avatar
🇺🇦
Stand with Ukraine

Thiago Holanda unnamedd

🇺🇦
Stand with Ukraine
View GitHub Profile
@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 / 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 / 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
View screen_cheatsheet.markdown

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r <session_name>
@unnamedd
unnamedd / .screenrc
Created Sep 7, 2020 — forked from joaopizani/.screenrc
A killer GNU Screen Config
View .screenrc
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off
View NSAttributedStringHighlight.swift
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 / PreviewDevice+ListOfPads.swift
Created Apr 25, 2020
A small extension for PreviewDevice to avoid enter the values in the SwiftUI previews manually
View PreviewDevice+ListOfPads.swift
/**
* PreviewDevice+ListOfPads.swift
* Copyright (c) Thiago Holanda 2020
* https://twitter.com/tholanda
*
* MIT license
*/
import SwiftUI