Skip to content

Instantly share code, notes, and snippets.

View jmoody's full-sized avatar

Joshua Moody jmoody

  • Germany
View GitHub Profile
> user = user_model()
#<UserModel:0x007fc843c61c00 @employee_id=nil, @team_id=nil>
> user.employee_id
130012147057
> user.team_id
1
> Cegedim::MI::Backdoor.select_todo_assignees(user, 3)
[
[0] "Small, Monica",
[1] "Winchester, Amanda",
@jmoody
jmoody / .bash_profile
Last active August 29, 2015 14:02
minimal bash profile
### .bash_history ###
# Erase duplicates
export HISTCONTROL=erasedups
# resize history size
export HISTSIZE=5000
# append to bash_history if Terminal.app quits
shopt -s histappend
### visual / editor ###
export VISUAL=less
@jmoody
jmoody / iframe_mixin.rb
Last active August 29, 2015 14:03
demonstrates how to use NSString stringByEvaluatingJavaScriptFromString: + calabash iOS to query and interact with iFrames in UIWebViews
module YourCompany
module YourApp
# a mixin interacting with UIWebViews with iframes
module IFrameMixin
include YourCompany::YourApp::WaitHelpers
# js = "document.getElementById('frame_0_1').contentDocument.querySelectorAll('#bt_2').toString();"
#query('webView', :stringByEvaluatingJavaScriptFromString => js)
#!/usr/bin/env bash
if [ "$USER" = "jenkins" ]; then
echo "INFO: hey, you are jenkins! loading ~/.bash_profile_ci"
source ~/.bash_profile_ci
hash -r
rbenv rehash
fi
TAGS=$*
@jmoody
jmoody / xcodebuild.md
Created August 13, 2014 20:46
xcodebuild output vs. xcpretty output for the same compiler error
** BUILD FAILED **


The following build commands failed:
	CompileC build/calabash.build/Debug-iphonesimulator/calabash-simulator.build/Objects-normal/i386/CalabashServer.o calabash/Classes/CalabashServer.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
@jmoody
jmoody / .env
Created August 21, 2014 21:45
example of how to use bundler + github + local repos to work with the calabash-ios toolchain
# Put this in the directory where your calabash.framework is.
# I hope that is the same directory where you execute cucumber from...
# Update the values to match your environment.
# replace with your bundle id
BUNDLE_ID=com.littlejoysoftware.Briar-cal
# to use $ bundle exec briar install calabash-server
CALABASH_SERVER_PATH="${HOME}/git/calabash-ios-server"
CALABASH_GEM_PATH="${HOME}/git/calabash-ios"
@jmoody
jmoody / run-loop-log.md
Created October 23, 2014 11:39
failure of touch on iPad 7.1.2 in landscape mode

{"status"=>"error", "value"=>"VerboseError: null", "backtrace"=>"fail__delegate@file:///Users/moody/git/briar-ios-example/Briar/762F73BD-7C52-498D-A565-A195333BA1B7/_run_loop.js:20854:28\nfail@file:///Users/moody/git/briar-ios-example/Briar/762F73BD-7C52-498D-A565-A195333BA1B7/_run_loop.js:20861:31\nfile:///Users/moody/git/briar-ios-example/Briar/762F73BD-7C52-498D-A565-A195333BA1B7/_run_loop.js:21352:38\nfile:///Users/moody/git/briar-ios-example/Briar/762F73BD-7C52-498D-A565-A195333BA1B7/_run_loop.js:11579:38\nlazy_seq_value@file:///Users/moody/git/briar-ios-example/Briar/762F73BD-7C52-498D-A565-A195333BA1B7/_run_loop.js:8173:24\ncljs$core$ISeq$_first$arity$1@file:///Users/moody/git/briar-ios-example/Briar/762F73BD-7C52-498D-A565-A195333BA1B7/_run_loop.js:8224:66\n_first@file:///Users/moody/git/briar-ios-example/Briar/762F73BD-7C52-498D-A565-A195333BA1B7/_run_loop.js:2763:46\nfirst@file:///Users/moody/git/briar-ios-example/Briar/762F73BD-7C52-498D-A565-A195333BA1B7/_run_loop.js:4231:35\ncljs$core$ISeq$_first

@jmoody
jmoody / errno-reproduce.md
Created November 17, 2014 18:14
Errno::EINTR: Interrupted system call @ rb_sysopen #35

Extracted from: calabash/run_loop#35

If instruments fails to execute the script using the method below, the problem is on Apple's side of the fence and there is very little we can do besides file bug reports and keep trying to discover the magical ritual that makes it work.

If instruments can execute the script using the method below, then we need to dig deeper into this issue.

Reproduce

  1. Install your app on the problem device; it can be any app that you have the bundle identifier for.
  2. Make a note of your device identifier.
@jmoody
jmoody / topic.md
Created December 3, 2014 11:44
Archive of "Errno::EINTR: Interrupted system call" run-loop issue #35 from calabash-ios wiki Hot Topics

2. Errno::EINTR: Interrupted system call

See the discussion here: calabash/run_loop#35

This is an active issue; no comprehensive solution exists yet.

You can see this error if:

  1. The bundle identifier is incorrect.
  2. The device is not enabled for UIAutomation. Starting in iOS 8, you must enable UIAutomation on the device using the switch in Settings.app > Developer > Enable UIAutomation.

We want to merge the Calabash Android and iOS gesture APIs.

Calabash Android has a three options that can be passed to a gesture:

  1. x => a percentage; how far away from the top-left corner on the x-axis to perform the gesture
  2. y => a percentage; how far away from the top-right corner on the y-axis to perform the gesture
  3. offset => {:x, :y} - how many points from the center of the view to perform the gesture

The x and y relative percentage is applied first and then from that point, the offset is calculated.