Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / 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 / access_label.m
Created February 1, 2012 22:30
Navigating UITableViews with UIAutomation
- (void)awakeFromNib
{
[self.tableView setaccessibilityLabel:@"first_table"];
[super awakeFromNib];
}
@Jaym3s
Jaym3s / .bash_profile.sh
Created February 21, 2012 19:57
my bash_profile with git status parsing
export ENV=$HOME/.bashrc
if [ -f "$ENV" ]; then
. "$ENV"
fi
# adds colors!
export CLICOLOR=1
# export LSCOLORS=EHfxCxDxbxegedabagacad # don't need in iterm2
@Jaym3s
Jaym3s / gist:1879478
Created February 21, 2012 22:30
BendyGlow css
.alert {
border: 2px solid #33B5E5;
box-shadow: 0 0 3px 3px #33B5E5, inset 0 0 20px 8px #22739B;
border-radius: 26px;
}
@Jaym3s
Jaym3s / setup.sh
Created February 27, 2012 19:08
hackday setup instructions
# Setup dotmatrix
cd ~
git clone https://github.com/bendyworks/dotmatrix &&
ln -s ~/dotmatrix/.ackrc .ackrc &&
ln -s ~/dotmatrix/.bash_aliases .bash_aliases &&
ln -s ~/dotmatrix/.bash_profile .bash_profile &&
ln -s ~/dotmatrix/.bashrc .bashrc &&
ln -s ~/dotmatrix/bin bin &&
ln -s ~/dotmatrix/.ctags .ctags &&
ln -s ~/dotmatrix/.cvsignore .cvsignore &&
@Jaym3s
Jaym3s / Gemfile
Created November 9, 2012 19:43
testing-security-with-brakeman
group :development do
gem 'guard-brakeman'
end
@Jaym3s
Jaym3s / pair.md
Last active December 18, 2015 01:48 — forked from wm/pair.md

SSH setup for remote pairing

If Animal and Fozzie wanted to pair on Animals machine and they both have access to shared.muppets.com then they could use the following setup

  • Animal will have the following in ~/.ssh/config
Host tunnel_from_muppets
  Hostname space.muppets.com
  RemoteForward 1235 localhost:22