This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# pbxproj_unused_files.rb | |
# v.1.0.0 | |
# | |
# Copyright (c) 2015 Kamil Borzym | |
# Released under the MIT License | |
# | |
require 'rubygems' | |
require 'json' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import Foundation; | |
#import <objc/runtime.h> | |
@interface TWTRGenericKeychainItem: NSObject | |
- (NSMutableDictionary *)fullRawRepresentation; | |
@end | |
@interface TWTRGenericKeychainItem (KeychainFix) | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var results = new(id) | |
var query = @{ kSecReturnAttributes : kCFBooleanTrue, | |
kSecMatchLimit: kSecMatchLimitAll, | |
kSecClass: kSecClassGenericPassword, | |
kSecReturnData: kCFBooleanTrue } | |
SecItemCopyMatching(query, results) | |
var r = *results |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
public extension Bundle { | |
private final class Marker {} | |
// Looking for bundle involves a lot of IO | |
private static let cache: NSCache<NSString, Bundle> = NSCache<NSString, Bundle>() | |
public static func resourcesBundle(forModuleName moduleName: String) -> Bundle { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
source_framework_path="$1" | |
target_bundle_dir="$2" | |
framework_name="$(basename "${source_framework_path}")" | |
module_name="$(basename -s .framework "${framework_name}")" | |
bundle_name="${module_name}.bundle" | |
target_bundle_path="${target_bundle_dir}/${bundle_name}" | |
print_usage() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script checks the binary and all nested frameworks for duplicated classes (both ObjectiveC and Swift). | |
# The script fails if it finds any duplicated classes. | |
function print_classes() { | |
otool -ov "$1" | | |
sed -n '/Contents of (__DATA,__objc_classlist)/,/Contents of/p' | # all lines for (__DATA,__objc_classlist) section | |
egrep '^[0-9]' | # take just a class header | |
cut -d ' ' -f 3 | # take just a symbol name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This snippet shows how to enable dyld `closured` and how to fix `read` implementation in dyld using lldb. | |
# Following text is a bash/lldb command mix and it contains the relevant stdout content and my comments. | |
// `DYLD_PRINT_WARNINGS=1` environment variable will print dyld logs | |
$ DYLD_PRINT_WARNINGS=1 lldb /Users/kamil.borzym/tmp/TestMacApp.app/Contents/MacOS/TestMacApp | |
(lldb) process launch --stop-at-entry | |
(lldb) image list | |
[ 0] D355CCB5-8584-33E3-8DF7-7BA95BAD41AF 0x0000000100000000 /Users/kamil.borzym/tmp/TestMacApp.app/Contents/MacOS/TestMacApp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>FILEHEADER</key> | |
<string> ___COPYRIGHT___</string> | |
<key>FILEHEADER_comment</key> | |
<string>FILEHEADER is the text placed at the top of every new text file. It can be overridden, but can not be removed.</string> | |
</dict> | |
</plist> |