Skip to content

Instantly share code, notes, and snippets.

View leviwilson's full-sized avatar

Levi Wilson leviwilson

  • Northwoods
  • Colorado, USA
View GitHub Profile
@leviwilson
leviwilson / PityFoo.cpp
Created February 16, 2012 14:34
implicit C++ constructor conversions
#include <stdio.h>
class Foo {
public:
Foo(int blar) {
_member = blar;
}
operator int() const {
@leviwilson
leviwilson / android_list_sdk
Created June 2, 2012 20:40
Android, Maven and Travis-CI
Packages available for installation or update: 66
1- Android SDK Tools, revision 19
2- Android SDK Platform-tools, revision 11
3- Documentation for Android SDK, API 15, revision 2
4- SDK Platform Android 4.0.3, API 15, revision 3
5- SDK Platform Android 4.0, API 14, revision 3
6- SDK Platform Android 3.2, API 13, revision 1
7- SDK Platform Android 3.1, API 12, revision 3
8- SDK Platform Android 3.0, API 11, revision 2
9- SDK Platform Android 2.3.3, API 10, revision 2
@leviwilson
leviwilson / .travis.yml
Created June 3, 2012 16:59
.travis.yml for building Android with the maven-android-plugin
language: java
before_install:
# download the latest android sdk and unzip
- wget http://dl.google.com/android/android-sdk_r18-linux.tgz
- tar -zxf android-sdk_r18-linux.tgz
# setup your ANDROID_HOME and PATH environment variables
- export ANDROID_HOME=~/builds/[github username]/[your project name]/android-sdk-linux
- export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
# only update the sdk for the tools and platform-tools (1,2) and whatever api level
# you are building for android (run "android list sdk" to get the full list. 9 = 2.3.3 or API level 10
@leviwilson
leviwilson / SomeActivityTest.java
Created August 28, 2012 17:30
Using the ShadowConnectivityManager in Robolectric
public class SomeActivityTest {
SomeActivity activity;
@Before
public void setUp() {
activity = new SomeActivity();
ConnectivityManager connectivityManager = getConnectivityManager();
Robolectric.shadowOf(connectivityManager).setNetworkInfo(TYPE_MOBILE, new NetworkInfo());
@leviwilson
leviwilson / another_way.rb
Created August 30, 2012 17:59
Reusing background steps
class LoginPage
include Gametel
text(:username, :index => 0)
text(:password, :index => 1)
def login_successfully
self.username = 'user'
self.password = 'secret'
on(LandingPage).should be_active
@leviwilson
leviwilson / GametelDriverGist.md
Created August 31, 2012 16:37
The gist of gametel driver

Command JSON Structure

  var singleCommand = {
    name:  "theMethodName",
    arguments:  ["array", 1, true, false, "of values to the method"],
    variable:  "@@variable_name_to_store_this_result@@", // (optional)
    target: "Robotium" // (optional) other option is LastResultOrRobotium (the default)
  };
@leviwilson
leviwilson / count_lines.sh
Created September 6, 2012 07:14
Lines Of Code Count
find . -name '*.java' | xargs wc -l
@leviwilson
leviwilson / jarjar.sh
Created September 7, 2012 03:37
jarjar
java -jar jarjar.jar process rules.txt gson-1.5.jar myjson-1.5.jar
@leviwilson
leviwilson / droid_java_maven
Created June 2, 2012 14:49
Ubuntu Android, Java and Maven Shell Script
# update packages
sudo apt-get update
# Install git
sudo apt-get install git-core
# Install jdk
sudo apt-get install openjdk-6-jdk
# Setup Maven
@leviwilson
leviwilson / example.rb
Created January 31, 2013 14:36
Example Furter screen definition
class Login
include Furter
text(:username, :label => 'UsernameAccessibilityId')
text(:password, :label => 'PasswordAccessibilityId')
button(:login, :text => 'Login')
end
include Furter::Navigation