Skip to content

Instantly share code, notes, and snippets.

View WowbaggersLiquidLunch's full-sized avatar
🗿
living in your walls

冀卓疌 WowbaggersLiquidLunch

🗿
living in your walls
  • subsistence phd
View GitHub Profile
import SwiftUI
import PlaygroundSupport
// constants
let deviceWidth: CGFloat = 320
let deviceHeight: CGFloat = 568
let hasFaceID = true // false for TouchID
struct Device: View {
var body: some View {
@beccadax
beccadax / Example.swift
Created July 26, 2016 12:28
Alternate design for RelativeRange
let array = Array(1...10)
array[.startIndex ..< 3]
array[.startIndex + 2 ..< .endIndex - 1]
@BrettBukowski
BrettBukowski / defaults
Created October 25, 2013 22:23
defaults write
#### Mail
# Disable send and reply animations in Mail.app
defaults write com.apple.Mail DisableReplyAnimations -bool YES
defaults write com.apple.Mail DisableSendAnimations -bool YES
# Copy email addresses as `foo@example.com` instead of `Foo Bar <foo@example.com>` in Mail.app
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false
# Disable inline attachments (just show the icons)
@username0x0a
username0x0a / Safari15StableBackFwdButtons.m
Created October 2, 2021 18:01
Safari 15 Stable Back & Forward buttons in the single-line Unified tab bar
#import <Cocoa/Cocoa.h>
#import <objc/runtime.h>
@interface Injector: NSView @end
@implementation Injector
+ (void)load {
@zhuowei
zhuowei / safariinject.m
Last active October 22, 2021 17:15
Restores old tab bar in Safari 15.0 (16612.1.29.41.4, 16612)
// Restores old tab bar in Safari 15.0 (16612.1.29.41.4, 16612)
// clang -fmodules -shared -Wall -Os -o libsafariinject.dylib safariinject.m
//
// If SIP off:
// DYLD_INSERT_LIBRARIES=$PWD/libsafariinject.dylib /Applications/Safari.app/Contents/MacOS/Safari
//
// If SIP on, you can demo this by manually removing Safari's code signing signature, but many
// features (eg saved logins) won't be readable by the resigned app:
// cp -a /Applications/Safari.app ./
// codesign --remove Safari.app/Contents/MacOS/Safari
@steipete
steipete / TouchBarSwiftUIHack.swift
Created April 19, 2021 15:17
Your SwiftUI app crashes in *** Assertion failure in -[NSTouchBarLayout setLeadingWidgetWidth:], NSTouchBarLayout.m:78 ? Use this hack to work around the problem!
import Foundation
import InterposeKit
import OSLog
/// Hack tow work around Assertion failure in -[NSTouchBarLayout setLeadingWidgetWidth:], NSTouchBarLayout.m:78
/// This sometimes happens when macOS restores a window.
/// This even runs if there is no OS-level touch bar.
class MacOSWorkarounds {
static let logger = Logger(category: "MacOSWorkarounds")
import SwiftUI
import PlaygroundSupport
struct Content: View {
@State var isExpanded = false
@State var wifiEnabled = true
@State var spacing: CGFloat = 12
var body: some View {
VStack(spacing: self.spacing) {
HStack(spacing: self.spacing) {
@jianpx
jianpx / wwdc2014-videos-and-pdf
Created June 7, 2014 13:42
wwdc 2014 videos and pdf download links, including HD/SD version.
http://devstreaming.apple.com/videos/wwdc/2014/403xxksrj0qs8c0/403/403_hd_intermediate_swift.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/403xxksrj0qs8c0/403/403_sd_intermediate_swift.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/403xxksrj0qs8c0/403/403_intermediate_swift.pdf?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/419xxli6f60a6bs/419/419_hd_advanced_graphics_and_animation_performance.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/419xxli6f60a6bs/419/419_sd_advanced_graphics_and_animation_performance.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/419xxli6f60a6bs/419/419_advanced_graphics_and_animation_performance.pdf?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/101xx36lr6smzjo/101/101_hd.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/101xx36lr6smzjo/101/101_sd.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/236xxwk3fv82sx2/236/236_hd_building_interruptible_and_responsive_interactions.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UnifiedBar</key>
<dict>
<key>DisclosureRequired</key>
<string>ace440ac-b4f6-4b43-aade-02bba1589aef</string>
<key>Enabled</key>
<false/>