Skip to content

Instantly share code, notes, and snippets.

@tternes
tternes / gist:2054687
Created March 17, 2012 03:25 — forked from skrul/gist:2051046
Symbolicating iOS crashes with Xcode 4.3.1's symbolicatecrash script
Seems to help now to give the path to the symbols that match the version of iOS that produced the crash.
For iOS 5.1:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash -v crashfile /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/5.1\ \(9B176\)/Symbols
For iOS 5.0.1:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash -v crashfile ~/Library/Developer/Xcode/iOS\ DeviceSupport/5.0.1\ \(9A405\)/Symbols
// .h
@interface NSNull (null)
+ (void) setWarnsOnNullAccess:(BOOL) warnsOnNullAccess;
- (BOOL) boolValue;
- (char) charValue;
- (NSDecimal) decimalValue;
- (double) doubleValue;
- (float) floatValue;
- (int) intValue;
#!/bin/sh
# Source: http://hints.macworld.com/article.php?story=20120701234338952
# Have you ever been annoyed to find that your Mac won't got to sleep when you tell it to?
# It turns out that in Mac OS X 10.6 and later, there's a simple way of finding out what's
# keeping your Mac awake.
# Run the following command in your Terminal:
# pmset -g assertions
@tternes
tternes / wwdc2012.rb
Last active December 12, 2015 12:19 — forked from jfahrenkrug/wwdc2013.rb
# in 2012 by Johannes Fahrenkrug, http://springenwerk.com
# See you at WWDC!
require 'rubygems'
require 'open-uri'
class WWDC2012
def self.announced?
begin
title = open('https://developer.apple.com/wwdc/') do |f|
#!/bin/sh
# Watch this for a while, then ctrl-c
sudo fs_usage -w -f "filesys"
A theory as to the ending of Breaking Bad...
White family: deceased
Hank and Marie: deceased
Kids: deceased
Walt: only one left, cancer cured
It was all for nothing.
//
// NSObject+BlockObservation.h
// Version 1.0
//
// Andy Matuschak
// andy@andymatuschak.org
// Public domain because I love you. Let me know how you use it.
//
#import <Cocoa/Cocoa.h>
@tternes
tternes / NSHomerString
Created November 25, 2013 18:05
NSHomerString
NSString *homer =
@"\n"
@" __ \n"
@" _ ,___,-'\",-=-. \n"
@" __,-- _ _,-'_)_ (\"\"`'-._\\ `. \n"
@" _,' __ |,' ,-' __) ,- /. | \n"
@" ,'_,--' | -' _)/ `\\ \n"
@" ,',' ,' ,-'_,` : \n"
@" ,' ,-' ,(,-( : \n"
@" ,' ,-' , _ ; \n"
@tternes
tternes / arc+retain.m
Created April 14, 2014 19:58
ARC + Retain Hack
- (id)swizzled_retain
{
NSLog(@"yes, I know");
return [self swizzled_retain];
}
+ (void)load
{
// swizzle retain
Class c = [self class];
@tternes
tternes / git-svn-clone.sh
Last active August 29, 2015 14:00
git-svn clone without the full repro
#!/bin/bash
########################################
# Quick and dirty script for cloning an svn branch with git without pulling the entire repo history
#
# Usage: git-svn-clone.sh <URL> <LOCAL_OUTPUT_PATH>
# e.g. git-svn-clone.sh http://myserver.com/svn/branches/feature-1.0 feature-1.0
#
########################################