Skip to content

Instantly share code, notes, and snippets.

View stevelandeyasana's full-sized avatar

Steve Landey stevelandeyasana

  • Asana
  • San Francisco, CA
  • X @irskep
View GitHub Profile

Every Mac Retina External Display Worth Considering

Companies besides Apple and LG have finally started releasing affordable retina-scale displays. I'm collecting them here mostly for my own notes.

A proper retina-scale external display for a Mac must have a pixel density of at least 200ppi. That means a 5K monitor should be 27" diagonal. 4K 27" monitors are disqualified.

Someone on the MacRumors forum made a comprehensive, less-up-to-date table, which might be worth looking at to see if I missed anything.

Released

@stevelandeyasana
stevelandeyasana / PDFPageView.swift
Created February 10, 2020 23:16
A UIView that renders a PDF page at a given resolution and constrains itself to the PDF page's aspect ratio
// Uses Cartography for layout, but you should be able to translate it to NSLayoutConstraint pretty easily
import Cartography
/// Render a single page of a PDF, non-interactive, at an arbitrary size.
/// Adds its own constraint to maintain its correct aspect ratio.
class PDFPageView: UIView {
var displayBox: PDFDisplayBox = .artBox
var majorAxisLength: CGFloat = 2048
var page: PDFPage? { didSet { applyState() } }
@stevelandeyasana
stevelandeyasana / XcodeAlfred.osascript
Created May 15, 2019 21:56
AppleScript to toggle between Xcode and Simulator
on alfred_script(q)
tell application "System Events" to set FrontAppName to name of first process where frontmost is true
if FrontAppName is "Xcode" then
tell app "Simulator" to activate
else
tell app "Xcode" to activate
end if
@stevelandeyasana
stevelandeyasana / hide_native_tabs.css
Created March 19, 2019 19:34
CSS to hide Firefox's tab bar but keep macOS window buttons (close/minimize/maximize)
/* add to your userChrome.css */
#TabsToolbar {
visibility: collapse;
overflow: visible;
}
#TabsToolbar > * {
visibility: collapse;
}