Skip to content

Instantly share code, notes, and snippets.


Thiago Holanda unnamedd

View GitHub Profile
unnamedd / Keycodes.swift
Created March 17, 2022 21:43 — 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 / BorderlessWindow.swift
Created December 30, 2021 10:31 — 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)
point.y += self.size.height * anchor.y
unnamedd / NSImageExtensions.swift
Created December 30, 2021 00:26 — 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 /
Created May 13, 2021 11:51 — forked from cellularmitosis/
QEMU PowerPC G4 OS X Tiger (10.4) setup
unnamedd /
Created May 13, 2021 11:49 — forked from openfirmware/
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).

unnamedd /
Created March 8, 2021 22:16 — forked from fnky/
ANSI Escape Codes

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


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 / .screenrc
Created September 7, 2020 19:35 — 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 / PreviewDevice+ListOfPads.swift
Created April 25, 2020 18:19
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
* MIT license
import SwiftUI