Skip to content

Instantly share code, notes, and snippets.

View dav's full-sized avatar

Dav Yaginuma dav

View GitHub Profile
describe(@"cardinalityPhraseWithNumber:singularPhrase:pluralPhrase:", ^{
it(@"should pluralize 0", ^{
NSString *phrase = [NSString cardinalityPhraseWithInteger:0 singularPhrase:@"bug" pluralPhrase:@"bugs"];
[[phrase should] equal:@"0 bugs"];
});
it(@"should singularize 1", ^{
NSString *phrase = [NSString cardinalityPhraseWithInteger:1 singularPhrase:@"bug" pluralPhrase:@"bugs"];
[[phrase should] equal:@"1 bug"];
});

Keybase proof

I hereby claim:

  • I am dav on github.
  • I am dav (https://keybase.io/dav) on keybase.
  • I have a public key whose fingerprint is 4C0B E5F1 E72A 2D93 0CB1 7DCA E6CA 6E5B 5202 4147

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am dav on github.
  • I am dav (https://keybase.io/dav) on keybase.
  • I have a public key whose fingerprint is 4C0B E5F1 E72A 2D93 0CB1 7DCA E6CA 6E5B 5202 4147

To claim this, I am signing this object:

@dav
dav / gist:6125671
Last active December 20, 2015 11:48
unit testing
http://stackoverflow.com/questions/12557935/xcode-4-5-command-line-unit-testing
-----------
For the GUI prompt hanging UIAutomation:
http://stackoverflow.com/questions/9476131/is-there-a-way-to-remove-the-authorization-prompt-from-command-line-instances-of
the /etc/auth trick may not be enough,
see also
DevToolsSecurity -enable
@dav
dav / gist:6125412
Created July 31, 2013 19:38
The .gitignore for tracking your Jenkins home dir into git
.owner
*.log
*.key
jobs/**/builds
jobs/**/lastStable
jobs/**/lastSuccessful
jobs/**/nextBuildNumber
log
plugins
*.bak
@dav
dav / tf-adhoc-build.sh
Created June 1, 2013 14:46
iOS build script that uploads to testflight and crittercism
set -e
# env vars to set outside of SCM:
#
# Testflight:
# TEAM_TOKEN
# API_TOKEN
#
# CRITTERCISM_KEY
# CRITTERCISM_SECRET
@dav
dav / gist:4127922
Created November 21, 2012 21:32
scribble booty
CoreFoundation`-[NSMutableArray removeObject:]:
0x38266e0: pushl %ebp
0x38266e1: movl %esp, %ebp
0x38266e3: pushl %ebx
0x38266e4: pushl %edi
0x38266e5: pushl %esi
0x38266e6: subl $44, %esp
0x38266e9: calll 0x38266ee ; -[NSMutableArray removeObject:] + 14
0x38266ee: popl %ebx
0x38266ef: movl %ebx, -32(%ebp)
@dav
dav / gist:3738695
Created September 17, 2012 17:40
Script to copy photos/videos into iPhone Simulator
require 'etc'
require 'fileutils'
# Copies the most recent MAX_IMAGES photos/videos from the device image dir.
# I use Dropbox to sync my device images to my workstation disk
MAX_IMAGES=500
USER_HOME_DIR = Etc::getpwuid.dir
DEVICE_IMAGES_DIR="#{USER_HOME_DIR}/Dropbox/Camera Uploads"
SIMULATOR_IMAGES_DIR="#{USER_HOME_DIR}/Library/Application Support/iPhone Simulator/5.1/Media/DCIM/100APPLE"
Here's just canada:
12 "calgary_alba_can"
3 "vancouver_bc_can"
3 "montreal_que_can"
2 "edmonton_alb_can"
1 "winnipeg_man_can"
1 "moose_jaw_sask_can"
1 "london_ont_can"
Printing description of originalURL:
<CFURL 0x5cdcbf0 [0x2875380]>{type = 15, string = https://s3.amazonaws.com/yaginuma/uploads/profiles/0e0fd1a7533188a9eee49e9f9027ee3b/woman-28.jpeg, encoding = 134217984, base = (null)}
Printing description of requestHeaders:
<CFBasicHash 0x5cd9520 [0x2875380]>{type = mutable dict, count = 4,
entries =>
0 : <CFString 0x41f64 [0x2875380]>{contents = "If-None-Match"} = <CFString 0x5cddcf0 [0x2875380]>{contents = ""f39761819de451a831c6ab7ab4900c12""}
1 : <CFString 0x41ff4 [0x2875380]>{contents = "User-Agent"} = <CFString 0x5cdbb30 [0x2875380]>{contents = "DatingApp 1.0 (iPhone Simulator; iPhone OS 4.0.1; en_US)"}
5 : <CFString 0x41f74 [0x2875380]>{contents = "If-Modified-Since"} = <CFString 0x5cddd20 [0x2875380]>{contents = "Sat, 14 Aug 2010 05:53:45 GMT"}
6 : <CFString 0x42004 [0x2875380]>{contents = "Accept-Encoding"} = <CFString 0x41f54 [0x2875380]>{contents = "gzip"}