Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Ashton-W
Ashton-W / Makefile
Created March 13, 2014 04:27
Alcatraz Makefile with check for xcpretty install
ARCHIVE = "Alcatraz.tar.gz"
BUNDLE_NAME = "Alcatraz.xcplugin"
VERSION_LOCATION = "Alcatraz/ATZVersion.h"
INSTALL_PATH = ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/${BUNDLE_NAME}/
DEFAULT_BUILD_ARGS = -workspace TestProject/TestProject.xcworkspace -scheme TestProject
XCODEBUILD = xcodebuild $(DEFAULT_BUILD_ARGS)
VERSION = $(shell grep 'ATZ_VERSION' Alcatraz/ATZVersion.h | cut -d " " -f 3 | tr -d '"')
XCPRETTY_INSTALLED = $(shell which xcpretty)
ifneq ($(strip $(XCPRETTY_INSTALLED)),)
$(info Using xcpretty)
@Ashton-W
Ashton-W / setup.sh
Created June 1, 2014 05:49
Building facebook/atosl on Linux
sudo apt-get libdwarf-dev libiberty-dev
make
@Ashton-W
Ashton-W / gist:8378a497379d4d1dbacf
Created July 5, 2014 05:00
UINavigationBar heights recorded on iOS 7.1
iPad: 44
iPhone: 44
iPhone-Landscape: 32
#! /bin/bash
# DHC - Hacked to always return a 0 code when successful.
SIM_DEVICES_FOLDER=~/Library/Developer/CoreSimulator/Devices
SIM_RUNTIME_PRFIX=com.apple.CoreSimulator.SimRuntime
function usage () {
echo "simulatorAppFolders (-s <name> | -d <device-type>) [-?] [-i <iOS version>] [-a <app-name>]"
echo "-? show help, and prints simulators currently installed"
@Ashton-W
Ashton-W / UIResponder+FirstResponder.m
Created October 1, 2014 07:46
UIResponder (FirstResponder) magic. Intercept UIControls calling `sendAction:to:from:forEvent:` and store a weak ref.
@implementation UIResponder (FirstResponder)
static __weak UIResponder *currentFirstResponder;
+ (instancetype)currentFirstResponder
{
[[UIApplication sharedApplication] sendAction:@selector(findCurrentFirstResponder:) to:nil from:self forEvent:nil];
return currentFirstResponder;
}
@Ashton-W
Ashton-W / AssertBlock.m
Created November 24, 2014 23:55
AssertBlock
// Is this a bad idea?
NSAssert(^BOOL() {
return YES;
}(), @"Assert");
@Ashton-W
Ashton-W / gist:9622ad5b8cb3ab570dd5
Created March 3, 2015 08:10
patched xctool crash with KIF
1) -[FAILED_BEFORE TESTS_RAN] (UI Tests.xctest)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Test did not run: the test bundle stopped running or crashed before the test suite started.
2015-03-03 19:07:35.874 LinkedStoryboards[43486:23529036] KIFTester loaded
CRASH REPORT: LinkedStoryboards_2015-03-03-190737_Ashton.crash
Process: LinkedStoryboards [43486]
Path: /Users/USER/Library/Developer/CoreSimulator/Devices/E330D0BB-C864-4F9A-9E65-3C6306C6A001/data/Containers/Bundle/Application/9AF432F6-C2F8-455E-B37D-5176716BFAC3/LinkedStoryboards.app/LinkedStoryboards
@Ashton-W
Ashton-W / .clang-format
Created April 22, 2015 07:23
my current clang format
---
Language: Cpp
BasedOnStyle: LLVM
AccessModifierOffset: -1
AlignEscapedNewlinesLeft: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortFunctionsOnASingleLine: None
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: true
BinPackParameters: false
@Ashton-W
Ashton-W / podopen.sh
Created November 7, 2012 09:54
small script to install pods and open the workspace
#!/bin/sh
# Add alias to .bash_profile
# alias podopen="sh ~/podopen.sh"
cd "$(dirname "$(find . -name Podfile)")" && pod install && open *.xcworkspace
@Ashton-W
Ashton-W / RVMSetup.sh
Created November 28, 2012 09:57
Install RVM, Resolve Segfault in OSX ssl
#!/bin/sh
#Install RVM
curl -L https://get.rvm.io | bash -s stable --ruby
#RVM Postsetup
source ~/.rvm/scripts/rvm
#Resolve issue with OSX SSL
rvm pkg install openssl