Skip to content

Instantly share code, notes, and snippets.

View markd2's full-sized avatar

Mark Dalrymple markd2

View GitHub Profile
I'm building an AVComposition. The audio plays back fine. The video is blind and silent. After the video's duration has elapsed the audio comes back in. The audio is coming from the itunes library and the video is a mp4 file sitting in the file system. The video plays fine with MPMoviePlayerController.
Here are the segments:
(lldb) po compositionVideoTrack.segments
<__NSArrayM 0x145f84d0>(
<AVCompositionTrackSegment: 0x145f85c0 timeRange [0.000,+440.256] from trackID 1 of asset file:///var/mobile/Applications/11472C08-EB4B-4566-8C09-DAFD90C904F6/Documents/.../globa-soaring_over_sori-italy-m-italy3.mp4 sourceTimeRange [0.000,+440.256]>
)
let fun: (() -> Bool)? = UIAccessibilityIsReduceMotionEnabled
switch fun {
case .Some(let x):
println("\(x)")
x() // gets here and dies on ios7
default:
println("gronk")
}
// Taken from the commercial iOS PDF framework http://pspdfkit.com.
// Copyright (c) 2013 Peter Steinberger. All rights reserved.
// Licensed under MIT (http://opensource.org/licenses/MIT)
//
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
//
// This version tweaked to work on Mac OS X / AppKit.
#import <Cocoa/Cocoa.h>
#import <objc/runtime.h>
var ExtractSelectedText = function() {};
ExtractSelectedText.prototype = {
run: function(options) {
var selectedText = "No Selection";
if (window.getSelection) {
selectedText = window.getSelection().getRangeAt(0).toString();
} else {
selectedText = document.getSelection().getRangeAt(0).toString();
@markd2
markd2 / gist.txt
Created August 19, 2014 21:43
hello extension!
There once was a Wookiee named Mikey
@markd2
markd2 / gist.txt
Created August 19, 2014 21:42
hello extension!
There once was a Wookiee named Mikey
@markd2
markd2 / gist.txt
Created August 19, 2014 20:02
hello extension!
There once was a Wookiee named Mikey
@markd2
markd2 / gist.txt
Created August 19, 2014 19:31
hello extension!
Mikey Rules™
@markd2
markd2 / launchHandler.m
Created July 2, 2014 19:33
Simple utility that uses Launch Services to see what applications would be interested in editing a given file.
@import Foundation;
@import CoreServices;
// clang -g -fobjc-arc -fmodules launchHandler.m -o launchHandler
int main (int argc, const char *argv[]) {
// Rudimentary argument checking.
if (argc != 2) {
printf ("usage: %s filename\n", argv[0]);
@markd2
markd2 / gist:9956630
Created April 3, 2014 15:31
Dangly Bits inside of UIKit
UIKit: 00596e34 t -[UIView(AdditionalLayoutSupport) _potentiallyHasDanglyConstraints]
UIKit: 001eb5b8 t -[UIView(AdditionalLayoutSupport) _setPotentiallyHasDanglyConstraints:]
UIKit: 000fa8e4 T __UIViewConstraintWithItemsIsPotentiallyDangly
UIKit: 00009edc t __UIViewRemoveConstraintsMadeDanglyByChangingSuperview
UIKit: 00596f78 t -[UIView(AdditionalLayoutSupport) _potentiallyHasDanglyConstraints]
UIKit: 001ebe9c t -[UIView(AdditionalLayoutSupport) _setPotentiallyHasDanglyConstraints:]
UIKit: 000fb05c T __UIViewConstraintWithItemsIsPotentiallyDangly
UIKit: 0000a474 t __UIViewRemoveConstraintsMadeDanglyByChangingSuperview
UIKit: 00000000006280fc t -[UIView(AdditionalLayoutSupport) _potentiallyHasDanglyConstraints]
UIKit: 000000000021836c t -[UIView(AdditionalLayoutSupport) _setPotentiallyHasDanglyConstraints:]