Skip to content

Instantly share code, notes, and snippets.

View alanzeino's full-sized avatar
🐱
cat

Alan Zeino alanzeino

🐱
cat
View GitHub Profile
@alanzeino
alanzeino / lldb-debugging.md
Last active February 27, 2024 14:06
LLDB debugging with examples

LLDB Debugging Cheat Sheet

Commands

LLDB Commands

LLDB comes with a great set of commands for powerful debugging.

help

Your starting point for anything. Type help to get a list of all commands, plus any user installed ones. Type 'help for more information on a command. Type help to get help for a specific option in a command too.

@alanzeino
alanzeino / new-mac.md
Last active January 31, 2024 06:35
New Mac Setup

All the stuff I do to set up a new Mac

Applications

  • 1Blocker
  • AirBuddy
  • Amphetamine
  • BlockBlock
  • DaisyDisk
  • Deliveries
  • Fantastical
  • HextEdit
@alanzeino
alanzeino / NavigationController.swift
Created January 8, 2017 00:12
Replacing a UINavigationController's default animation transition with a custom transition
//
// NavigationController.swift
//
import UIKit
class NavigationController: UINavigationController {
init() {
super.init(nibName: nil, bundle: nil)
#!/usr/bin/swift
// Run: $ swift noCrashplan.swift
// Background: https://github.com/KrauseFx/overkill/issues/3#issuecomment-270505227
import Foundation
import Cocoa
import ServiceManagement
let badApps = [ "Code42 CrashPlan", "CrashPlanService", "CrashPlanLauncher", "CrashPlanWeb" ]
static UICollectionViewListCell *userCell(UICollectionView *collectionView, NSIndexPath *indexPath, NSArray<RTTweet *> *tweets) {
UICollectionViewListCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"UserCell" forIndexPath:indexPath];
UIListContentConfiguration *contentConfiguration = [UIListContentConfiguration valueCellConfiguration];
contentConfiguration.image = nil;
RTTweet *tweet = tweets[indexPath.row];
contentConfiguration.text = tweet.user.username;
contentConfiguration.secondaryText = [tweet.user.followers az_formattedStringForCount];
@alanzeino
alanzeino / Strong UINavigationBar colour
Last active April 26, 2020 23:34
Combining a strong colour with a blurred and translucent UINavigationBar in iOS 7.
// cheers to @stroughtonsmith for helping out with this one
UIColor *barColour = [UIColor colorWithRed:0.13f green:0.14f blue:0.15f alpha:1.00f];
UIView *colourView = [[UIView alloc] initWithFrame:CGRectMake(0.f, -20.f, 320.f, 64.f)];
colourView.opaque = NO;
colourView.alpha = .7f;
colourView.backgroundColor = barColour;
self.navigationBar.barTintColor = barColour;
@alanzeino
alanzeino / gist:0a421075385408fb71032eba7bef518f
Created August 7, 2017 18:10
Xcode Post–Upgrade Clean
$ sudo rm -rf ~/Library/Caches/com.apple.dt.Xcode \
rm -rf ~/Library/Developer/Xcode/DerivedData \
sudo rm -rf "$(getconf DARWIN_USER_CACHE_DIR)org.llvm.clang.$USER/ModuleCache" \
sudo /usr/libexec/xpccachectl
@alanzeino
alanzeino / gist:e388864414e5c2c78f67b049b88948f8
Created November 6, 2018 20:55
Xcode 10.1 Release Notes Change
Before November 6:
"Resolves an issue that affected app compatibility with iOS 9.0, 9.1 and 9.2. Apps containing asset catalogs built with Xcode 10 whose deployment target was set to iOS 9.0, 9.1 or 9.2 would produce content incompatible with the runtimes of those iOS versions. Rebuilding the application with Xcode 10.1 resolves this issue. (44535967)"
After November 6:
"Known Issues
Apps that contain asset catalogs built using Xcode 10 or later with a deployment target set to iOS 9.0, 9.1 or 9.2 produce content incompatible with the runtimes of those iOS versions. (44535967, 45723580, 45723189)"
@alanzeino
alanzeino / codegen.swift
Last active October 26, 2018 20:53
swiftsyntax simple class/struct gen example
struct MockGenType {
let name: String
let isOptional: Bool
init(name: String, isOptional: Bool = false) {
self.name = name
self.isOptional = isOptional
}
func libRepresentation(hasDefault: Bool = false) -> OptionalTypeSyntax {
@alanzeino
alanzeino / gist:97676005e37e6d869401a5adb5777d76
Created October 21, 2018 05:46
Xcode 10 new clang flags
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;