Skip to content

Instantly share code, notes, and snippets.

@toolbear
toolbear / cj.md
Last active August 29, 2015 13:59
debating ownCloud's selection of PHP
View cj.md

A side-channel response to my "recent tirade against PHP on BoingBoing".

Subject: Computer language designers, or how to shoot yourself in the foot.
From: CJ <c…@gmail.com>
To: Tim Taylor <tim@tool-man.org>
Date: Mon, 14 Apr 2014 22:15:37 -0500

In your recent tirade against PHP on BoingBoing, you capped your arguments with:

My top gripes are that PHP:

View upload-to-appstore.sh
#!/bin/bash
set -ex
# This scripts allows you to upload a binary to the iTunes Connect Store and do it for a specific app_id
# Because when you have multiple apps in status for download, xcodebuild upload will complain that multiple apps are in wait status
# Requires application loader to be installed
# See https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/SubmittingTheApp.html
# Itunes Connect username & password
USER=bla
@toolbear
toolbear / gist:861192
Created March 8, 2011 22:10
Using p4merge with Git Mac OS X
View gist:861192

Git config

$ git config --global -e
[merge]
    keepBackup = false;
    tool = p4merge
[mergetool "p4merge"]
    cmd = p4merge "$BASE" "$REMOTE" "$LOCAL" "$MERGED"

keepTemporaries = false

@toolbear
toolbear / capslock2control.reg
Created March 23, 2011 18:43
Remap Capslock key to Left Control key in Windows
View capslock2control.reg
REGEDIT4
[HKEY_CURRENT_USER\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00
@toolbear
toolbear / xml-decode.pl
Created June 9, 2011 18:11
decoding XML inside <content>{encoded XML}</content>
View xml-decode.pl
# usage:
# perl xml-decode.pl FILE
use XML::LibXML;
binmode STDOUT;
my $parser = XML::LibXML->new();
my $doc = $parser->parse_file($ARGV[0]);
@toolbear
toolbear / gist:1384302
Created November 21, 2011 23:10
prompt for jsibbold
View gist:1384302
if [ "$PS1" != "" ] ; then # Interactive shells only
case "$TERM" in
xterm*|vt100|screen|ansi)
export PS1="\[\033[0;36m\]\u@$(hostname):\$($HOME/.shortpwd)\[\033[0m\]\$ "
;;
*)
export PS1="\u@$(hostname):\$($HOME/.shortpwd)\$ "
;;
esac
fi
@toolbear
toolbear / ProtocolConformingReturnTypeExpectationsSpec.m
Created March 12, 2012 18:06
Kiwi false pass with protocol conforming objects as return types
View ProtocolConformingReturnTypeExpectationsSpec.m
#import "Kiwi.h"
@protocol Proto <NSObject>
- (void)beep;
@end
@interface Conformer : NSObject <Proto>
@end
@implementation Conformer
- (void)beep {}
@toolbear
toolbear / gist:3152486
Created July 20, 2012 18:41
An `any` matcher for Kiwi similar to Mockito's `any()`
View gist:3152486
@interface Any : NSObject <HCMatcher>
@end
@implementation Any
- (BOOL)isEqual:(id)object { return object != [KWNull null]; }
- (BOOL)matches:(id)item { return YES; }
@end
@toolbear
toolbear / session-abstract.md
Created August 24, 2012 16:29
Cocoa Gets Its Big Boy Pants
View session-abstract.md

The programming environment for iOS and OS X — shorthand Cocoa — is a fascinating mix of polished, mature tools and immature or non-existent tools. This shows in the relative recency of official testing support, lack of official library dependency management, and the new growth of projects in the Cocoa ecosystem to fill these gaps. Mature in terms of getting products to market, the iOS developer community is just now walking around on its feet when it comes to practices Rubyists, for example, take for granted.

Demonstrated through building a new Cocoa Touch app, I will show what modern iOS development looks like using mostly Open Source tools and frameworks:

  • CocoaPods for managing library dependencies
  • Kiwi BDD for RSpec style testing
  • Frank/Cucumber for automated specification testing of the UI
  • Jenkins for Continuous Integration
  • Test Flight for over-the-air Continuous Delivery
@toolbear
toolbear / NSString+DLStringUtil.h
Created September 5, 2012 19:35
Category on NSString for Java developers accustomed to StringUtils
View NSString+DLStringUtil.h
#import <Foundation/Foundation.h>
@interface NSString (DLStringUtil)
- (BOOL)DL_isNotEmpty;
- (BOOL)DL_isNotBlank;
@end