Skip to content

Instantly share code, notes, and snippets.

View mkuliszkiewicz's full-sized avatar
👋

Maciej Kuliszkiewicz mkuliszkiewicz

👋
View GitHub Profile
@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:
@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 / 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

//
// 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>
var subscriptableArray = ["zero", "one", "two", "three"]
let rangeX = 1...3
subscriptableArray[rangeX] // :(
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
@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
# This is not a ready-to-run script. It just shows the relevant command-line calls.
XC_WORKSPACE=path/to/MyApp.xcworkspace
XC_SCHEME=MyApp
XC_CONFIG=Release
ARCHIVE_PATH=dest/path/to/MyApp.xcarchive
EXPORT_PATH=dest/path/to/MyApp.ipa
DIST_PROFILE=NameOfDistributionProfile
# Build and archive. This can be done by regular developers, using their developer key/profile.
require 'plist'
# xcode 6.2 A16FF353-8441-459E-A50C-B071F53F51B7
plugins_path = File.expand_path('~') + "/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/"
Dir.foreach(plugins_path) do |fname|
if fname != '.' && fname != '..' && fname != '.DS_Store'
plist_path = plugins_path + fname.to_s + '/Contents/Info.plist'
if File.exist?(plist_path)
application_plist = Plist::parse_xml(plist_path)
current_uuids = application_plist['DVTPlugInCompatibilityUUIDs']
/// Observes a run loop to detect any stalling or blocking that occurs.
///
/// This class is thread-safe.
@interface GHRunLoopWatchdog : NSObject
/// Initializes the receiver to watch the specified run loop, using a default
/// stalling threshold.
- (id)initWithRunLoop:(CFRunLoopRef)runLoop;
/// Initializes the receiver to detect when the specified run loop blocks for