Skip to content

Instantly share code, notes, and snippets.

Kamil Borzym kam800

  • Poland
View GitHub Profile
kam800 / IDETemplateMacros.plist
Created Sep 2, 2018
View IDETemplateMacros.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<string> ___COPYRIGHT___</string>
<string>FILEHEADER is the text placed at the top of every new text file. It can be overridden, but can not be removed.</string>
View lldb_read_fix.txt
# 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/
(lldb) process launch --stop-at-entry
(lldb) image list
[ 0] D355CCB5-8584-33E3-8DF7-7BA95BAD41AF 0x0000000100000000 /Users/kamil.borzym/tmp/
# 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
framework_name="$(basename "${source_framework_path}")"
module_name="$(basename -s .framework "${framework_name}")"
print_usage() {
View Bundle+Resources.swift
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 {
View List keychain items using cycript
var results = new(id)
var query = @{ kSecReturnAttributes : kCFBooleanTrue,
kSecMatchLimit: kSecMatchLimitAll,
kSecClass: kSecClassGenericPassword,
kSecReturnData: kCFBooleanTrue }
SecItemCopyMatching(query, results)
var r = *results
kam800 / TWTRGenericKeychainItem.m
Created Jan 20, 2016
Override TwitterKit keychain kSecAttrAccessible to kSecAttrAccessibleAfterFirstUnlock
View TWTRGenericKeychainItem.m
@import Foundation;
#import <objc/runtime.h>
@interface TWTRGenericKeychainItem: NSObject
- (NSMutableDictionary *)fullRawRepresentation;
@interface TWTRGenericKeychainItem (KeychainFix)
kam800 / pbxproj_unused_files.rb
Created Jan 19, 2015
Prints files that where not added to all xcode targets given in parameter
View pbxproj_unused_files.rb
# pbxproj_unused_files.rb
# v.1.0.0
# Copyright (c) 2015 Kamil Borzym
# Released under the MIT License
require 'rubygems'
require 'json'
You can’t perform that action at this time.