Skip to content

Instantly share code, notes, and snippets.

View jmoody's full-sized avatar

Joshua Moody jmoody

  • Germany
View GitHub Profile
#!/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 / README.md
Last active March 18, 2016 19:59
Two ways to handle the "Some App wants to use your current location" alert

The problem is that this kind of UIAlert appears before Instruments can take control of the app.

In most cases, applications that ask for location services, access to contacts, access to photos, etc, are violating the Mobile HIG guidelines.

from the HIG

Ask permission at app startup only if your app can’t perform its primary function without the user’s data.

People will not be bothered by this if it’s obvious that the main function of your app depends on knowing their personal information.

@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)
@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
> 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 / a.rb
Last active August 29, 2015 14:01
deprecate a ruby constant
def self.const_missing(const_name)
if const_name == :FRAMEWORK_VERSION
_deprecated('0.9.169', 'no replacement', :warn)
return nil
end
raise(NameError, "uninitialized constant Calabash::Cucumber::#{const_name}")
end
@wip
Scenario: Add a fountain to the Map
WARN: server version is not compatible with gem version
please update your server and gem
gem version: '0.9.169.pre6'
min server version: '0.9.169.pre6'
server version: '0.9.169.pre2'
Given the app has started
Then I should see a button to create new fountains
@jmoody
jmoody / paste.md
Created May 23, 2014 13:41
required information for analyzing calabash iOS issues

Please paste the output of the following commands:

# xcode installation location
$ xcode-select --print-path

# xcode version
$ xcodebuild -version

# calabash version
[alias]
co = checkout
st = status
br = branch
[push]
default = current
xcodebuild \
-workspace wetap.xcworkspace \
-scheme wetap \
-configuration AdHoc \
-destination 'platform=iOS Simulator,name=iPhone Retina (4-inch),OS=latest' \
clean test | rbenv exec bundle exec xcpretty -c
codebuild[44797:4403] DVTAssertions: Warning in /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-5067/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/SpecificationTypes/BuiltInSpecifications/Compilers/XCGccMakefileDependencies.m:76
Details: Failed to load dependencies output contents from ``/Users/moody/Library/Developer/Xcode/DerivedData/wetap-gijejwfevueujveyphhohjhctvrf/Build/Intermediates/wetap.build/AdHoc-iphonesimulator/wetap.build/Objects-normal/i386/WtMapView.d''. Error: Error Domain=NSCocoaErrorDomain Code=260 "The file “WtMapView.d” couldn’t be opened because there is no such file." UserInfo=0x7faebb761570 {NSFilePath=/Users/moody/Library/Developer/Xcode/DerivedData/wetap-gijejwfevueujveyphhohjhctvrf/Build/Intermediates/wetap.build/AdH