Skip to content

Instantly share code, notes, and snippets.

@Jaym3s
Jaym3s / access_label.m
Created February 1, 2012 22:30
Navigating UITableViews with UIAutomation
- (void)awakeFromNib
{
[self.tableView setaccessibilityLabel:@"first_table"];
[super awakeFromNib];
}
@Jaym3s
Jaym3s / UIAutomation_script.js
Created February 1, 2012 17:43
UIAutomation and Pusher
var host = UIATarget.localTarget().host();
var timeout = 5; // seconds
var args = ['test_channel', 'test-event', '{"hello":"world"}'];
var scriptPath = "/Users/home/me/pusher_script";
var result = host.performTaskWithPathArgumentsTimeout(scriptPath,args,timeout);
@Jaym3s
Jaym3s / pusher_event.sh
Created February 1, 2012 17:10
pusher_event_script with RVM
#!/usr/bin/env bash
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
source "$HOME/.rvm/scripts/rvm"
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
source "/usr/local/rvm/scripts/rvm"
else
printf "ERROR: An RVM installation was not found.\n"
fi
@Jaym3s
Jaym3s / RestKitExample.m
Created January 30, 2012 20:03
RestKit loadObjectsAtResourcePath
RKObjectManager *manager = [RKObjectManager sharedManager];
RKObjectMapping *mapping = [manager.mappingProvider objectMappingForKeyPath:@"BWCDRepository"];
[manager loadObjectsAtResourcePath:@"/repositories.json"
objectMapping:mapping
delegate:nil];
@Jaym3s
Jaym3s / gist:1373996
Created November 17, 2011 18:24
Database Garbage collection for cucumber
module Cucumber
RETAINED_OBJECTS_FOR_CUCUMBER = []
end
Before('@release') do
module ActiveRecord
class Base
def create_with_cucumber *args
Cucumber::RETAINED_OBJECTS_FOR_CUCUMBER << self
create_without_cucumber *args