Skip to content

Instantly share code, notes, and snippets.

View mkuliszkiewicz's full-sized avatar
🚴

Maciej Kuliszkiewicz mkuliszkiewicz

🚴
  • Kraków / Stockholm
View GitHub Profile
@mkuliszkiewicz
mkuliszkiewicz / gist:f916a0bc2d8f4efe3854
Created April 16, 2015 17:25
Xcode bot post integration
export IPA_PATH="${XCS_OUTPUT_DIR}/${XCS_BOT_NAME}.ipa"
fastlane bot
lane :bot do
crashlytics({
crashlytics_path: '<path to crashlytics framework>',
api_token: '<key>',
build_secret: '<secret>',
ipa_path: ENV['IPA_PATH'],
groups: '<groups>',
notifications: false
})
snapshot
var subscriptableArray = ["zero", "one", "two", "three"]
let rangeX = 1...3
subscriptableArray[rangeX] // :(
//
// ViewController.m
// AVPlayerCaching
//
// Created by Anurag Mishra on 5/19/14.
// Sample code to demonstrate how to cache a remote audio file while streaming it with AVPlayer
//
#import "ViewController.h"
#import <AVFoundation/AVFoundation.h>
@mkuliszkiewicz
mkuliszkiewicz / ios_imperatives_for_approval.md
Created July 15, 2016 10:27 — forked from nickbauman/ios_imperatives_for_approval.md
Condensed iOS Human Interface Guidelines, formulated as imperatives.

Condensed iOS Human Interface Guidelines

Imperatives for AppStore approval

For iPhone app developers. Emphasis on getting the fastest app store approval. Everything stated as suggestion made into an imperative. When "violating" these imperatives, you can check for yourself what the caveats are. Generally speaking, deviating will more likely cause you app to be hung up in approval.

You can read this entire document in about 20 minutes. This is faster than reading and understanding the entire Human Interface Guidelines.

Overview

@mkuliszkiewicz
mkuliszkiewicz / gist:c81e4a0e84d9e7db5ffbff2879062366
Created July 15, 2016 12:47
LLDB Cast address to Obj-C object while using swift
expr -l objc++ -O -- [(UIWebView *)0x7fa1d8e37320 stringByEvaluatingJavaScriptFromString:@"document.body.innerHTML"]
@mkuliszkiewicz
mkuliszkiewicz / CommonCryptoHack
Last active August 17, 2016 15:15 — forked from iosdevzone/CommonCryptoHack
A shell script to write a dummy CommonCrypto.framework module into the directory where playgrounds look for frameworks.
#!/bin/bash
if [[ $BASH_SOURCE != $0 ]]; then echo "$BASH_SOURCE must be executed, not sourced."; return 255; fi
#
# A script to fool iOS playgrounds into allowing access to CommonCrypto
#
# The script creates a dummy CommonCrypto.framework in the SDK's System
# Framework Library Directory with a module map that points to the
# umbrella header
#
# Usage:
ACTION = build
AD_HOC_CODE_SIGNING_ALLOWED = NO
ALTERNATE_GROUP = staff
ALTERNATE_MODE = u+w,go-w,a+rX
ALTERNATE_OWNER = grantdavis
ALWAYS_SEARCH_USER_PATHS = NO
ALWAYS_USE_SEPARATE_HEADERMAPS = YES
APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer
APPLE_INTERNAL_DIR = /AppleInternal
APPLE_INTERNAL_DOCUMENTATION_DIR = /AppleInternal/Documentation
#import <objc/runtime.h>
void DumpObjcMethods(Class clz) {
unsigned int count = 0;
Method *methods = class_copyMethodList(clz, &count);
printf("Found %d methods on '%s'\n", count, class_getName(clz));
for (unsigned int i = 0; i < count; i++) {
@mkuliszkiewicz
mkuliszkiewicz / EpsCompare.swift
Last active March 6, 2017 20:42
Compare 2 CGFloats
extension CGFloat {
static var eps: CGFloat {
if CGFLOAT_IS_DOUBLE == 1 {
return CGFloat(DBL_EPSILON)
} else {
return CGFloat(FLT_EPSILON)
}
}
}