Skip to content

Instantly share code, notes, and snippets.

Matt mcmurrym

Block or report user

Report or block mcmurrym

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mcmurrym
mcmurrym / pods_mac_catalyst.rb
Last active Aug 16, 2019
Load this file at the top of your Podfile `load 'pods_mac_catalyst.rb'` in your post_install function call this: adjust_pod_installation_for_mac_catalyst(installer, [pods_with_bundles], 'dev team idea to assign to pod bundles')
View pods_mac_catalyst.rb
# frozen_string_literal: true
require 'set'
def adjust_pod_installation_for_mac_catalyst(installer, resource_bundles_needing_dev_team, team_id)
puts('Updating Pod Configuration To Support Mac Catalyst')
exclusions = scan_for_exclusions(installer)
update_xcconfig(installer, exclusions)
update_frameworks_script(installer, exclusions)
disable_mac_catalyst_build_setting(installer.pods_project.targets, exclusions)
@mcmurrym
mcmurrym / TestRepeater.swift
Created Jan 31, 2019
Repeat a test till it fails. This can be used to help troubleshoot tests with intermittent failures and to grow confidence in the code being tested or the test itself, being fixed
View TestRepeater.swift
#!/usr/bin/swift
import Foundation
class TestRepeater {
func runTest() {
let result = shell("/usr/bin/xcodebuild", [
"-project", "PSKit.xcodeproj",
"-scheme", "PSKit",
"test-without-building",
@mcmurrym
mcmurrym / evaluate.m
Created Dec 18, 2017
NSExpression works great on the simulator and does not work on the device when using %@ and/or stringByAppendingFormat:
View evaluate.m
- (void)evaluate {
NSExpression *expression = [NSExpression expressionWithFormat:@"FUNCTION(source.firstName, 'stringByAppendingFormat:', ' %@', source.lastName)"];
NSDictionary *expressionObject = @{NSMigrationSourceObjectKey: @{@"firstName": @"tacos", @"lastName": @"burger"}};
id result = [expression expressionValueWithObject:expressionObject context:nil];
NSLog(@"%@", result);
}
//on simulator: "tacos burgers"
//on device: "tacos %@"
View Stick Flow Layout props
iPad 9.7 inch
Portrait
.large
minimumInteritemSpacing: 40.0
minimumLineSpacing: 30.0
sectionInset: UIEdgeInsets(top: 7.0, left: 35.0, bottom: 7.0, right: 35.0)
itemSize: (206.0, 206.0)
@mcmurrym
mcmurrym / MirrorDebugDecscription.swift
Last active Jul 20, 2019
A default protocol implementation for CustomDebugStringConvertible that uses Mirror for introspection
View MirrorDebugDecscription.swift
public extension CustomDebugStringConvertible {
var debugDescription: String {
return debugDescription()
}
func debugDescription(_ indentationLevel: Int = 0, includeType: Bool = true) -> String {
let indentString = (0..<indentationLevel).reduce("") { tabs, _ in tabs + "\t" }
var s: String
@mcmurrym
mcmurrym / UIViewIBLayoutMarginSupport.swift
Last active Aug 29, 2015
Add Layout margin controls to IB. I hope Apple eventually integrates a layoutMargin attribute control into IB, until then this should do the trick. Just drop it in to your project and it should show up in IB. For iOS 8.0 and up
View UIViewIBLayoutMarginSupport.swift
// UIViewIBLayoutMarginSupport.swift
// Created by Matt McMurry on 5/26/15.
import UIKit
public extension UIView {
@IBInspectable public var leftLayoutMagrin: CGFloat {
set {
var margins = layoutMargins
margins.left = newValue
@mcmurrym
mcmurrym / gist:4b8c81e9214d00a20727
Created May 4, 2015
How to Check the "Allow app extension API only" of pod frameworks.
View gist:4b8c81e9214d00a20727
post_install do |installer|
installer.project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'YES'
end
end
end
View gist:46c993ee02d0bd70290e
UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom];
button1.translatesAutoresizingMaskIntoConstraints = NO;
button1.backgroundColor = [UIColor greenColor];
[button1 setTitle:@"button1" forState:UIControlStateNormal];
UIButton *button2 = [UIButton buttonWithType:UIButtonTypeCustom];
button2.translatesAutoresizingMaskIntoConstraints = NO;
button2.backgroundColor = [UIColor redColor];
[button2 setTitle:@"button2" forState:UIControlStateNormal];
You can’t perform that action at this time.