Skip to content

Instantly share code, notes, and snippets.

def desired_caps
{
caps: {
:'appium-version' => '1.1.0',
platformName: 'Android',
platformVersion: '4.2.2',
deviceName: 'Android Emulator',
app: '<path>'
#app: '<alternate_path>'
},
info: --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"ios","app":"/Users/tcollins/Documents/Git/bi-iPhone/iPhoneBI/build/Debug-iphonesimulator/iPhoneBI.app","#app":"/Users/tcollins/Documents/TestTools/appium/sample-code/apps/UICatalog/build/Release-iphonesimulator/UICatalog.app","deviceName":"iPhone Simulator"}}
debug: Appium request initiated at /wd/hub/session
info: <-- POST /wd/hub/session 303 1.583 ms - 9
debug: Request received with params: {"desiredCapabilities":{"platformName":"ios","app":"/Users/tcollins/Documents/Git/bi-iPhone/iPhoneBI/build/Debug-iphonesimulator/iPhoneBI.app","#app":"/Users/tcollins/Documents/TestTools/appium/sample-code/apps/UICatalog/build/Release-iphonesimulator/UICatalog.app","deviceName":"iPhone Simulator"}}
debug: Appium request initiated at /wd/hub/session/4e23b43c-111b-40e0-a10b-08cfa03126ce
debug: Request received with params: {}
debug: Responding to client with success: {"status":0,"value":{"webStorageEnabled":false,"locationContextEnabled":false,"brow
import collections, json
from urllib import urlretrieve
from urlparse import urljoin
from csv import DictReader, reader as csv_reader
import scrapinghub
from project.settings import SH_APIKEY

YARD CHEATSHEET http://yardoc.org

cribbed from http://pastebin.com/xgzeAmBn

Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.

Modules

Namespace for classes and modules that handle serving documentation over HTTP

@bootstraponline
bootstraponline / gist:9d17040deb5b08dde28e
Last active August 29, 2015 14:25
Client Side Xpath
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPath;
@bootstraponline
bootstraponline / full-page-screenshots-selenium-chrome.rb
Created September 22, 2015 15:28 — forked from elcamino/full-page-screenshots-selenium-chrome.rb
How to take full-page screenshots with Selenium and Google Chrome in Ruby
#!/usr/bin/env ruby
require 'selenium-webdriver'
wd = Selenium::WebDriver.for :remote, url: 'http://10.3.1.7:4444/wd/hub', desired_capabilities: :chrome
wd.navigate.to 'https://snipt.net/restrada/python-selenium-workaround-for-full-page-screenshot-using-chromedriver-2x/'
# Get the actual page dimensions using javascript
#
width = wd.execute_script("return Math.max(document.body.scrollWidth, document.body.offsetWidth, document.documentElement.clientWidth, document.documentElement.scrollWidth, document.documentElement.offsetWidth);")
@bootstraponline
bootstraponline / LICENSE
Created November 19, 2015 17:57 — forked from sinisterchipmunk/LICENSE
tar, gzip, and untar files using ruby in memory without tempfiles
Copyright (C) 2011 by Colin MacKenzie IV
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in

It looks like the Simulator.app binary is now signed as of Xcode 7 as the following occurs in instruments-without-delay when using the build script:

./build.sh test <SIMULATOR-UDID>

The message that we get from the kernel is: 7/23/15 12:22:52.000 PM kernel[0]: AMFI: Simulator(pid 72600) - [deny-mmap] mapped file has no team identifier and is not a platform binary: /Users/lawrencelomax/src/instruments-without-delay/build/SimShim.dylib

This causes a crash:

@bootstraponline
bootstraponline / DebugApiModule.java
Created February 3, 2016 16:07 — forked from mkuprionis/DebugApiModule.java
Retrofit API wrapper to be used when testing with Espresso
@Module(
complete = false,
library = true,
overrides = true
)
public final class DebugApiModule {
@Provides @Singleton ApiEndpoint provideApiEndpoint(Locale locale, @ApiEndpointMarker StringPreference apiEndpoint,
@NetworkIgnoreLocale BooleanPreference ignoreLocale) {
return (ignoreLocale.get())
@bootstraponline
bootstraponline / remove-boilerplate-comments-from-xcode-templates.sh
Created May 26, 2016 20:57
Remove Useless Header comments from Xcode Templates
#!/bin/bash
# Usage:
# $ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates
# $ bash ~/remove-boilerplate-comments-from-xcode-templates.sh
# Repeat for /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates
find -E . -type f \
\( -regex '.*\.[chm]' -or -regex '.*\.swift' \) \
-exec sed -i '' '1,/^$/d' '{}' ';'